开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜