Jump to content

C++ Singleton Class Question/Problem


Go to solution Solved by ricky92,

Recommended Posts

Iam currently stuck with a Singleton Class problem (err:https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif).

 

In my header file i bequeathed the singleton class to my CMyClass Class

class CMyClass: public singleton<CMyClass>

Do I have to something else apart from bequeathing? Because Everytime i try to execute the function I get the error above. Without the Singleton Function it is working.

So there is no logic mistake. 

 

Can Somebody explain me what i have to do in order to use the ymir Singleton template Class?

 

Kind Regards

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

  • Solution

The singleton class in Ymir's sources does not make use of lazy initialization, so you actually need to explicitly initialize it somewhere. Open up the main.cpp file and you'll see many (if not all) of the singleton classes initialized on the stack there: do the same for your class and it should work fine.

Link to comment
Share on other sites

  • 9 years later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.