removed wxApp::DoInit(); added wxApp::CreateMessageOutput(); fixed wxMsgOutput memory leak

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16859 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-08-30 00:58:34 +00:00
parent 98020767fd
commit a69be60b0f
4 changed files with 71 additions and 58 deletions

View File

@@ -50,16 +50,11 @@ wxMessageOutput* wxMessageOutput::ms_msgOut = 0;
wxMessageOutput* wxMessageOutput::Get()
{
// FIXME this is an hack
static bool inGet = FALSE;
if(!ms_msgOut && wxTheApp && !inGet)
if ( !ms_msgOut && wxTheApp )
{
inGet = TRUE;
wxTheApp->DoInit();
ms_msgOut = wxTheApp->CreateMessageOutput();
}
inGet = FALSE;
return ms_msgOut;
}
@@ -115,15 +110,15 @@ void wxMessageOutputMessageBox::Printf(const wxChar* format, ...)
void wxMessageOutputLog::Printf(const wxChar* format, ...)
{
wxString out;
va_list args;
va_start(args, format);
wxString out;
out.PrintfV(format, args);
va_end(args);
out.Replace(wxT("\t"),wxT(" "));
// under Motif, wxMessageDialog needs a parent window, so we use
// wxLog, which is better than nothing
::wxLogMessage(wxT("%s"), out.c_str());
}