[vlc-commits] [Git][videolan/vlc][master] 2 commits: win32: thread: ensure all thread variables from VLC have been deleted

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Oct 15 09:23:17 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
5f1dd4ca by Steve Lhomme at 2021-10-15T07:56:18+00:00
win32: thread: ensure all thread variables from VLC have been deleted

If not we are leaking a TlsAlloc ID and it make indicate other leaks in
more threads.

- - - - -
e24e9473 by Steve Lhomme at 2021-10-15T07:56:18+00:00
os2: thread: ensure all thread variables from VLC have been deleted

If not we are leaking a TlsAlloc ID and it make indicate other leaks in
more threads.

- - - - -


2 changed files:

- src/os2/thread.c
- src/win32/thread.c


Changes:

=====================================
src/os2/thread.c
=====================================
@@ -905,6 +905,9 @@ unsigned long _System _DLL_InitTerm(unsigned long hmod, unsigned long flag)
         case 1 :    /* Termination */
             wait_bucket_destroy();
 
+            // all thread vars should be deleted
+            assert(vlc_threadvar_last == NULL);
+
             _CRT_term();
 
             return 1;


=====================================
src/win32/thread.c
=====================================
@@ -786,6 +786,11 @@ BOOL WINAPI DllMain (HANDLE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
             break;
         }
 
+        case DLL_PROCESS_DETACH:
+            // all thread vars should have been deleted
+            assert(vlc_threadvar_last == NULL);
+            break;
+
         case DLL_THREAD_DETACH:
             vlc_threadvars_cleanup();
             break;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e0c0da604dc01862db0761e9318d26fd88ce49a3...e24e9473031e0c9a3316130c0995d2250e5ef55d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e0c0da604dc01862db0761e9318d26fd88ce49a3...e24e9473031e0c9a3316130c0995d2250e5ef55d
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list