开发者

c++ Static variables in dynamic DLL lifetime. or why they dead?

开发者 https://www.devze.com 2023-02-14 19:26 出处:网络
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??

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消