[SOLVED] Crash when initializing CEGUI/Ogre

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

Stefan Lundmark
Just popping in
Just popping in
Posts: 16
Joined: Wed Oct 14, 2009 22:11

[SOLVED] Crash when initializing CEGUI/Ogre

Postby Stefan Lundmark » Thu Oct 29, 2009 11:48

I'm getting a crash inside CEGUI 0.7.1 when initializing it with my Ogre RenderWindow.

Code: Select all

   CEGUI::OgreRenderer &renderer = CEGUI::OgreRenderer::bootstrapSystem (*mRenderWindow);
   CEGUI::System::create (renderer);


The RenderWindow passed is correct as the game works correctly without CEGUI. This is the assertion error:

Assertion Failed!

Expression: !ms_Singleton


System::create () creates the System Object but inside its constructor it dies.

_wassert(const wchar_t * expr=0x010fb3ec, const wchar_t * filename=0x01328ad0, unsigned int lineno=73) Line 335 C
CEGUI::Singleton<CEGUI::System>::Singleton<CEGUI::System>() Line 73 + 0x1a bytes C++
> CEGUI::System::System(CEGUI::Renderer & renderer={...}, CEGUI::ResourceProvider * resourceProvider=0x00000000, CEGUI::XMLParser * xmlParser=0x00000000, CEGUI::ImageCodec * imageCodec=0x00000000, CEGUI::ScriptModule * scriptModule=0x00000000, const CEGUI::String & configFile={...}, const CEGUI::String & logFile={...}) Line 229 + 0x54 bytes C++
CEGUI::System::create(CEGUI::Renderer & renderer={...}, CEGUI::ResourceProvider * resourceProvider=0x00000000, CEGUI::XMLParser * xmlParser=0x00000000, CEGUI::ImageCodec * imageCodec=0x00000000, CEGUI::ScriptModule * scriptModule=0x00000000, const CEGUI::String & configFile={...}, const CEGUI::String & logFile={...}) Line 1823 + 0x4a bytes C++


Running a debug build, statically linked. Log says nothing.
Last edited by Stefan Lundmark on Thu Oct 29, 2009 12:06, edited 1 time in total.

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Re: Crash (with nothing in the log) when initializing CEGUI/Ogre

Postby Van » Thu Oct 29, 2009 12:01

Code: Select all

   CEGUI::System::create (renderer);


Eliminate the above statement from your code. You don't need to do it if you are using bootstrap(). You are trying to instantiate a second instance of CEGUI::System which is not permitted. bootstrap() initializes everything you need.

Stefan Lundmark
Just popping in
Just popping in
Posts: 16
Joined: Wed Oct 14, 2009 22:11

Re: Crash (with nothing in the log) when initializing CEGUI/Ogre

Postby Stefan Lundmark » Thu Oct 29, 2009 12:05

Just found out that the System object is created inside the bootstrap function.

In any case, making it clearer that the System object already has been created wouldn't hurt?

Edit: Thanks Van for confirming!

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Re: [SOLVED] Crash when initializing CEGUI/Ogre

Postby Van » Thu Oct 29, 2009 12:10

Hence:

Assertion Failed!

Expression: !ms_Singleton


Singleton meaning "single instance". When the class was instantiated the ms_Singleton pointer was set. If you try to instantiate another class instance it checks the ms_Singleton pointer and throws the assertion error if it's already been set (i.e. an instance of the class already exists).

Edit: No problem! :wink: Good luck!


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 9 guests