g_displayDC = new MGLDisplayDC(mode, 1, refresh);
if ( !g_displayDC->isValid() )
{
- delete g_displayDC;
- g_displayDC = NULL;
+ wxDELETE(g_displayDC);
return false;
}
MGL_wmDestroy(g_winMng);
g_winMng = NULL;
}
- if ( g_displayDC )
- {
- delete g_displayDC;
- g_displayDC = NULL;
- }
+ wxDELETE(g_displayDC);
}
//-----------------------------------------------------------------------------
unsigned w, h, bpp;
if ( !wxGetEnv(wxT("WXMODE"), &mode) ||
- (wxSscanf(mode.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3) )
+ (wxSscanf(mode.c_str(), wxT("%ux%u-%u"), &w, &h, &bpp) != 3) )
{
w = 640, h = 480, bpp = 16;
}
if ( !wxAppBase::OnInitGui() )
return false;
-#ifdef __WXDEBUG__
// MGL redirects stdout and stderr to physical console, so lets redirect
- // it to file in debug build. Do it only when WXSTDERR environment variable is set
+ // it to file if WXSTDERR environment variable is set to be able to see
+ // wxLogDebug() output
wxString redirect;
if ( wxGetEnv(wxT("WXSTDERR"), &redirect) )
freopen(redirect.mb_str(), "wt", stderr);
-#endif // __WXDEBUG__
wxLog *oldLog = wxLog::SetActiveTarget(new wxLogGui);
if ( oldLog ) delete oldLog;