Skip to content

Commit e011ad8

Browse files
authored
Merge pull request #2372 from martin-frbg/winexit
Do not run any cleanup if the program is exiting anyway
2 parents 093d37d + 23f322f commit e011ad8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

exports/dllinit.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved) {
5050
gotoblas_init();
5151
break;
5252
case DLL_PROCESS_DETACH:
53-
gotoblas_quit();
53+
// If the process is about to exit, don't bother releasing any resources
54+
// The kernel is much better at bulk releasing then.
55+
if (!reserved)
56+
gotoblas_quit();
5457
break;
5558
case DLL_THREAD_ATTACH:
5659
break;

0 commit comments

Comments
 (0)