diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/window.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/window.h | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index cd526db98..53bf92cc0 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -150,7 +150,8 @@ Window::Window(const std::string &caption, mStickyButton(false), mSticky(false), mStickyButtonLock(false), - mPlayVisibleSound(false) + mPlayVisibleSound(false), + mInit(false) { logger->log("Window::Window(\"%s\")", caption.c_str()); @@ -261,6 +262,11 @@ Window::~Window() mGrip->decRef(); mGrip = nullptr; } + if (!mInit) + { + logger->log("error: Window created without calling postInit(): " + + mWindowName); + } } void Window::setWindowContainer(WindowContainer *const wc) diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 386b7e16b..83f88f726 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -286,8 +286,7 @@ class Window notfinal : public BasicContainer2, { mSaveVisible = save; } virtual void postInit() - { - } + { mInit = true; } /** * Returns the parent window. @@ -705,6 +704,7 @@ class Window notfinal : public BasicContainer2, bool mSticky; /**< Window resists hiding*/ bool mStickyButtonLock; /**< Window locked if sticky enabled*/ bool mPlayVisibleSound; + bool mInit; }; #endif // GUI_WIDGETS_WINDOW_H |