X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ee96a251c9556d4d410a860c211a56834f18c7f..77a1771911ed222ba6861ead327c3735fc16a0b1:/src/common/init.cpp?ds=sidebyside diff --git a/src/common/init.cpp b/src/common/init.cpp index 9b87e18152..bed80097dd 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -179,7 +179,8 @@ static void ConvertArgsToUnicode(int argc, char **argv) gs_initData.argv = new wchar_t *[argc + 1]; for ( int i = 0; i < argc; i++ ) { - gs_initData.argv[i] = wxStrdup(wxConvLocal.cMB2WX(argv[i])); + wxWCharBuffer buf(wxConvLocal.cMB2WX(argv[i])); + gs_initData.argv[i] = buf ? wxStrdup(buf) : NULL; } gs_initData.argc = argc; @@ -216,7 +217,7 @@ static bool DoCommonPreInit() // initialization simply disappear under Windows // // note that we will delete this log target below - wxLog::SetActiveTarget(new wxLogBuffer); + delete wxLog::SetActiveTarget(new wxLogBuffer); #endif // wxUSE_LOG return true; @@ -356,8 +357,6 @@ static void DoCommonPostCleanup() { wxModule::CleanUpModules(); - wxClassInfo::CleanUp(); - // we can't do this in wxApp itself because it doesn't know if argv had // been allocated #if wxUSE_UNICODE @@ -477,7 +476,7 @@ void wxUninitialize() { wxCRIT_SECT_LOCKER(lockInit, gs_initData.csInit); - if ( !--gs_initData.nInitCount ) + if ( --gs_initData.nInitCount == 0 ) { wxEntryCleanup(); }