From 10f77f010f8831368ab359074f6e0640961f3818 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Sat, 27 Aug 2005 18:53:39 +0000 Subject: Bail out early if there's no window container. --- ChangeLog | 9 +++++---- src/gui/window.cpp | 11 +++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2086bd54..ca437178 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,10 @@ 2005-08-27 Björn Steinbrink - * src/engine.cpp, src/game.cpp, src/gui/stats.cpp, src/gui/stats.h, - src/gui/status.cpp, src/gui/status.h: Update the stats and status - window contents only at a single location and let them do it - automagically. + * src/gui/window.cpp: Bail out early if there's no window container. + * src/engine.cpp, src/game.cpp, src/gui/stats.cpp, src/gui/stats.h, + src/gui/status.cpp, src/gui/status.h: Update the stats and status + window contents only at a single location and let them do it + automagically. * src/gui/updatewindow.cpp, src/gui/updatewindow.h: Small cleanups. 2005-08-25 Ferreira Yohann diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 4184f17a..0fe941bc 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -55,6 +55,10 @@ Window::Window(const std::string& caption, bool modal, Window *parent): { logger->log("Window::Window(\"%s\")", caption.c_str()); + if (!windowContainer) { + throw GCN_EXCEPTION("Window::Window. no windowContainer set"); + } + if (instances == 0) { // Load static resources @@ -85,12 +89,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent): setContent(chrome); // Add this window to the window container - if (windowContainer) { - windowContainer->add(this); - } - else { - throw GCN_EXCEPTION("Window::Window. no windowContainer set"); - } + windowContainer->add(this); // Send GUI alpha changed for initialization optionChanged("guialpha"); -- cgit v1.2.3-70-g09d2