Skip to content

Commit

Permalink
Merge pull request #2372 from martin-frbg/winexit
Browse files Browse the repository at this point in the history
Do not run any cleanup if the program is exiting anyway
  • Loading branch information
martin-frbg authored Jan 21, 2020
2 parents 093d37d + 23f322f commit e011ad8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion exports/dllinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved) {
gotoblas_init();
break;
case DLL_PROCESS_DETACH:
gotoblas_quit();
// If the process is about to exit, don't bother releasing any resources
// The kernel is much better at bulk releasing then.
if (!reserved)
gotoblas_quit();
break;
case DLL_THREAD_ATTACH:
break;
Expand Down

0 comments on commit e011ad8

Please sign in to comment.