summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/libgl-gdi
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/targets/libgl-gdi')
-rw-r--r--src/gallium/targets/libgl-gdi/libgl_gdi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/targets/libgl-gdi/libgl_gdi.c b/src/gallium/targets/libgl-gdi/libgl_gdi.c
index 112904ab5fe..3f7dc00b080 100644
--- a/src/gallium/targets/libgl-gdi/libgl_gdi.c
+++ b/src/gallium/targets/libgl-gdi/libgl_gdi.c
@@ -159,8 +159,10 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
break;
case DLL_PROCESS_DETACH:
- stw_cleanup_thread();
- stw_cleanup();
+ if (lpReserved == NULL) {
+ stw_cleanup_thread();
+ stw_cleanup();
+ }
break;
}
return TRUE;