mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
fix: re-enable Framework::OnDestroy hook
This commit is contained in:
parent
f937467eed
commit
a899cc7b4b
1 changed files with 4 additions and 7 deletions
|
|
@ -97,8 +97,8 @@ namespace Dalamud.Game.Internal {
|
||||||
this.updateHook = new Hook<OnUpdateDetour>(pUpdate, new OnUpdateDetour(HandleFrameworkUpdate), this);
|
this.updateHook = new Hook<OnUpdateDetour>(pUpdate, new OnUpdateDetour(HandleFrameworkUpdate), this);
|
||||||
|
|
||||||
var pDestroy = Marshal.ReadIntPtr(vtable, IntPtr.Size * 3);
|
var pDestroy = Marshal.ReadIntPtr(vtable, IntPtr.Size * 3);
|
||||||
//this.destroyHook =
|
this.destroyHook =
|
||||||
// new Hook<OnDestroyDetour>(pDestroy, new OnDestroyDelegate(HandleFrameworkDestroy), this);
|
new Hook<OnDestroyDetour>(pDestroy, new OnDestroyDelegate(HandleFrameworkDestroy), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Enable() {
|
public void Enable() {
|
||||||
|
|
@ -106,7 +106,7 @@ namespace Dalamud.Game.Internal {
|
||||||
Network.Enable();
|
Network.Enable();
|
||||||
|
|
||||||
this.updateHook.Enable();
|
this.updateHook.Enable();
|
||||||
//this.destroyHook.Enable();
|
this.destroyHook.Enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
|
|
@ -114,7 +114,7 @@ namespace Dalamud.Game.Internal {
|
||||||
Network.Dispose();
|
Network.Dispose();
|
||||||
|
|
||||||
this.updateHook.Dispose();
|
this.updateHook.Dispose();
|
||||||
//this.destroyHook.Dispose();
|
this.destroyHook.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool HandleFrameworkUpdate(IntPtr framework) {
|
private bool HandleFrameworkUpdate(IntPtr framework) {
|
||||||
|
|
@ -165,9 +165,7 @@ namespace Dalamud.Game.Internal {
|
||||||
|
|
||||||
private IntPtr HandleFrameworkDestroy() {
|
private IntPtr HandleFrameworkDestroy() {
|
||||||
Log.Information("Framework::OnDestroy!");
|
Log.Information("Framework::OnDestroy!");
|
||||||
return this.destroyHook.Original();
|
|
||||||
|
|
||||||
/*
|
|
||||||
// Store the pointer to the original trampoline location
|
// Store the pointer to the original trampoline location
|
||||||
var originalPtr = Marshal.GetFunctionPointerForDelegate(this.destroyHook.Original);
|
var originalPtr = Marshal.GetFunctionPointerForDelegate(this.destroyHook.Original);
|
||||||
|
|
||||||
|
|
@ -177,7 +175,6 @@ namespace Dalamud.Game.Internal {
|
||||||
|
|
||||||
// Return the original trampoline location to cleanly exit
|
// Return the original trampoline location to cleanly exit
|
||||||
return originalPtr;
|
return originalPtr;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue