From 3e23102435cb5c97a71548232ae37978a6755e8d Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Fri, 12 Dec 2008 15:58:03 +0000 Subject: [PATCH] don't assert at startup because of the static initialization of a wxLocale object requires a valid wxAppTraits object; init the locale later, in TestDefaultLang() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/console/console.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/samples/console/console.cpp b/samples/console/console.cpp index ce887b1a59..8fb03b87d1 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -987,7 +987,10 @@ static void TestFileSetTimes() #include "wx/intl.h" #include "wx/utils.h" // for wxSetEnv -static wxLocale gs_localeDefault(wxLANGUAGE_ENGLISH); +static wxLocale gs_localeDefault; + // NOTE: don't init it here as it needs a wxAppTraits object + // and thus must be init-ed after creation of the wxInitializer + // class in the main() // find the name of the language from its value static const wxChar *GetLangName(int lang) @@ -1236,6 +1239,8 @@ static void TestDefaultLang() { wxPuts(_T("*** Testing wxLocale::GetSystemLanguage ***")); + gs_localeDefault.Init(wxLANGUAGE_ENGLISH); + static const wxChar *langStrings[] = { NULL, // system default @@ -2768,8 +2773,8 @@ protected: wxString type, val; for ( size_t n = 0; frame.GetParam(n, &type, &name, &val); n++ ) { - printf("\t%s %s = %s\n", (const char*)type.mb_str(), - (const char*)name.mb_str(), + printf("\t%s %s = %s\n", (const char*)type.mb_str(), + (const char*)name.mb_str(), (const char*)val.mb_str()); } } @@ -3436,7 +3441,7 @@ static void TestZipStreamRead() static const wxString filename = _T("foo"); wxFFileInputStream in(TESTFILE_ZIP); - wxZipInputStream istr(in); + wxZipInputStream istr(in); wxZipEntry entry(filename); istr.OpenEntry(entry); -- 2.45.2