[PATCH] Add an assertion to prevent MainWindow from being recreated
Thiago Macieira
thiago at macieira.org
Tue Feb 18 16:47:21 UTC 2014
Signed-off-by: Thiago Macieira <thiago at macieira.org>
---
qt-ui/mainwindow.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 42b07fb..7609bff 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -46,6 +46,7 @@ MainWindow::MainWindow() : QMainWindow(),
helpView(0),
state(VIEWALL)
{
+ Q_ASSERT_X(m_Instance == NULL, "MainWindow", "MainWindow recreated!");
m_Instance = this;
ui.setupUi(this);
setWindowIcon(QIcon(":subsurface-icon"));
--
1.8.4.5
More information about the subsurface
mailing list