]> git.saurik.com Git - wxWidgets.git/commitdiff
This is a quick hack: if there is no global wxMessageOutput instance, and
authorMattia Barbon <mbarbon@cpan.org>
Thu, 1 Aug 2002 19:58:32 +0000 (19:58 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Thu, 1 Aug 2002 19:58:32 +0000 (19:58 +0000)
there is a wxApp instance, call wxTheApp->DoInit() to initialize the
global wxMessageOutput instance. The correct solution is to ensure that
wxApp::DoInit is always called.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/msgout.cpp

index c677a6bef1a0689cde93f51fc93df1d3dfc61f37..512c9b62684f7072c85e61438113661453487b41 100755 (executable)
@@ -50,6 +50,16 @@ wxMessageOutput* wxMessageOutput::ms_msgOut = 0;
 
 wxMessageOutput* wxMessageOutput::Get()
 {
+    // FIXME this is an hack
+    static bool inGet = FALSE;
+
+    if(!ms_msgOut && wxTheApp && !inGet)
+    {
+        inGet = TRUE;
+        wxTheApp->DoInit();
+    }
+
+    inGet = FALSE;
     return ms_msgOut;
 }