What happens to global variables declared in a DLL?

后端 未结 6 743
眼角桃花
眼角桃花 2020-11-27 14:47

Let\'s say I write a DLL in C++, and declare a global object of a class with a non-trivial destructor. Will the destructor be called when the DLL is unloaded?

6条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 15:13

    This page from Microsoft goes into the details of DLL initialization and destruction of globals:
    http://msdn.microsoft.com/en-us/library/988ye33t.aspx

提交回复
热议问题