diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 7296444c79..d15e4a5d41 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -128,6 +128,12 @@ wxAppConsole::~wxAppConsole() bool wxAppConsole::Initialize(int& argc, wxChar **argv) { + // If some code logged something before wxApp instance was created, + // wxLogStderr was set as the target. Undo it here by destroying the + // current target. It will be re-created next time logging is needed, but + // this time wxAppTraits will be used: + delete wxLog::SetActiveTarget(NULL); + // remember the command line arguments this->argc = argc; this->argv = argv;