c++, multiple instances of a dll, singleton
问题 I have got a DLL in which a singleton is defined. I have got an app which can load multiple instances of this DLL. The DLL needs a singleton instance per DLL instance, otherwise it will crash. I observed that there was only one singleton instance for multiple DLL instances. Why? How can I resolved it (if possible, without refactoring the singleton into something else)? Thanks for any help. 回答1: You mentioned that you have multiple instances inside your app , which implies that they all live