V37.1 ExitFix: detach model hooks before D3D9 cleanup

This commit is contained in:
Dusk-92
2026-08-29 11:46:48 +02:00
parent 1969bb83bd
commit 2a51ab6030
+4 -1
View File
@@ -109,8 +109,11 @@ pub fn initD3D9Deferred() void {
/// Remove all outline hooks. Called during DLL_PROCESS_DETACH.
pub fn cleanup() void {
if (g_is_hook_owner) {
d3d9_hook.removeHooks();
// ExitFix: stop any future self-heal first, then detach the model hooks
// that can call lateRehookIfLost(), and only then tear down D3D9.
d3d9_hook.beginShutdown();
model_hook.removeHooks();
d3d9_hook.removeHooks();
log.close();
mod_mutex.release(&g_mutex);
}