V34 ExitFix: skip heavy cleanup during process termination

This commit is contained in:
Dusk-92
2026-08-29 18:07:38 +02:00
parent c35b95a4c4
commit 2a3befd970
+8 -2
View File
@@ -1048,11 +1048,17 @@ comptime {
pub export fn DllMain(
_: ?*anyopaque,
reason: u32,
_: ?*anyopaque,
reserved: ?*anyopaque,
) callconv(WINAPI) std.os.windows.BOOL {
switch (reason) {
1 => install(),
0 => uninstall(),
0 => {
// Process-exit safety: when Windows is terminating the whole
// process, do not call heavy cleanup from DLL_PROCESS_DETACH.
// Resources are reclaimed by the OS. Explicit FreeLibrary still
// performs the normal uninstall path.
if (reserved == null) uninstall();
},
else => {},
}
return @enumFromInt(1);