在 2018/8/2 13:56, Martin Storsjö 写道: > Yes, a responsible user would join all his threads before calling exit() > or returning from main, there's no disagreement about that. > > But the problematic case I'm thinking about is when you load and unload > e.g. plugins, which may contain TLS objects. If more than one long > running threads (which aren't stopped meanwhile) touch the plugin while > it is loaded (with proper synchronization of course), you'll have leaks. > > // Martin
I don't know how many people unload DLLs in practice. AFAIU once a DLL is loaded and a function from it is called, it is virtually impossible to eliminate the possibility of references of anything in that DLL, especially C++ RTTI, virtual functions, specialized function templates, etc. If people don't ever unload a DLL, thread local objects in that DLL will be considered reachable and therefore are not leaks. -- Best regards, LH_Mouse ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public