From e6dc1413391dec5d38a1b624a20c8f7c51d210e6 Mon Sep 17 00:00:00 2001 From: twanvl Date: Fri, 28 Jan 2011 14:12:26 +0000 Subject: [PATCH] Don't segfault on errors during construction of ConsolePanel git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1645 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gui/set/console_panel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/set/console_panel.cpp b/src/gui/set/console_panel.cpp index d4f3c69a..3acc8049 100644 --- a/src/gui/set/console_panel.cpp +++ b/src/gui/set/console_panel.cpp @@ -295,6 +295,8 @@ ConsolePanel::ConsolePanel(Window* parent, int id) , is_active_window(false) , blinker_state(0) , blinker_timer(this) + , messages(nullptr) + , entry(nullptr) { // init controls splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); @@ -363,6 +365,8 @@ void ConsolePanel::onIdle(wxIdleEvent&) { } void ConsolePanel::get_pending_errors() { + // The panel might not be initialized yet, in particular, construction of controls might fail, which results in a popup dialog with an event loop + if (!messages) return; // add pending messages MessageType type; String msg;