Jump to content
  • 0

Launcher crash when I initialize a variable


Cataclismo

Question

  • VIP

Hi,

So, as the title says my client launcher is crashing when I initialize a variable.

I declared a class like this:

class CMyClass : public CSingleton<CMyClass>
{
	private:
		int var;
	public:
		void Initialize();
}

And the function Initialize():

void CMyClass::Initialize()
{
	var = 123;
}

No error at compilation, but when I run the launcher it's crashing.

I don't get it. Why is this happening?

Link to comment

5 answers to this question

Recommended Posts

  • 0
  • VIP

You have to create at least one instance of the class before you're using singleton.

 

I don't get what you're exactly saying, but I've tried to call my function using these two ways:

CMyClass::instance().Initialize();

and

CMyClass mc;
mc.Initialize();
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Read our Rules
  • Activity

    1. 0

      Help with quest

    2. 0

      Will anyone modify the mount?Mounts need to be mounted to increase their stats.

    3. 11

      Lock Picking Skill + Missions

    4. 4

      Quest Deleter

    5. 1

      [SOLUTION IN TOPIC]Loading locale_game.txt raises KeyError

    6. 1

      Binary functions: "GetSlotLocalPosition" & "GetSlotGlobalPosition"

    7. 1

      Binary functions: "GetSlotLocalPosition" & "GetSlotGlobalPosition"

    8. 1

      [SOLUTION IN TOPIC]Loading locale_game.txt raises KeyError

    9. 6

      Skill Book Combination System

  • Recently Browsing

    No registered users viewing this page.

×
×
  • 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.