c++ Static variables in dynamic DLL lifetime. or why they dead?
so, I load Dll with some global static variables(loggers). and there is no freelibrar开发者_JAVA技巧y. on close application I call methods from dll but global static variables already destroyed. why???
The static variables in the DLL will be destroyed when the DLL is unloaded. This will happen when the process exits, before the static variables from the main EXE are destroyed, if there is no explicit FreeLibrary
call to make it happen earlier.
精彩评论