Code: Select all
//// Disable logging in CEGUI for Release build
#ifndef _DEBUG
class CeguiNonLogger : public CEGUI::Logger{
void logEvent (const CEGUI::String&, CEGUI::LoggingLevel){}
void setLogFilename(const CEGUI::String&, bool){}
};
CeguiNonLogger g_ceguiNonLogger;
#endif
But when I do that, when exiting my app I get a failed assertion at CEGUISingleton.h, line 77:
Code: Select all
~Singleton( void )
{ assert( ms_Singleton ); ms_Singleton = 0; }
Do I need to postpone the instantiation of my logger until a certain point or something?
Edit: I tried making my logger a member variable of my app's main class, and I still had the same problem; then I made it a pointer and instantiated it the line before creating the CEGUI renderer and system objects, and there was no assertion failure . But this is also a memory leak, right? And I'm just avoiding the assertion by avoiding the CEGUISingleton destructor since I never delete the logger? Or does the logger automatically get deleted, which is why it is 0 in the destructor when I don't heap-allocate it or delete it myself?