Browse Source

win32: Don't run cleanup if we're about to exit anyway

If the process is about to exit, there's no point trying to do
a bunch of work to clean up resources. The kernel will release
them much more efficiently when the process exits at the end
of this function.
pull/2350/head
Keno Fischer 6 years ago
parent
commit
b16fa2e711
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      exports/dllinit.c

+ 4
- 1
exports/dllinit.c View File

@@ -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;


Loading…
Cancel
Save