summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtMainWindowFactory.cpp')
-rw-r--r--Swift/QtUI/QtMainWindowFactory.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Swift/QtUI/QtMainWindowFactory.cpp b/Swift/QtUI/QtMainWindowFactory.cpp
index dc1949e..10b122a 100644
--- a/Swift/QtUI/QtMainWindowFactory.cpp
+++ b/Swift/QtUI/QtMainWindowFactory.cpp
@@ -9,13 +9,15 @@ QtMainWindowFactory::QtMainWindowFactory(QtTreeWidgetFactory *treeWidgetFactory)
}
MainWindow* QtMainWindowFactory::createMainWindow(UIEventStream* eventStream) {
- QtMainWindow* window = new QtMainWindow(eventStream, treeWidgetFactory_);
- lastWindow_ = window;
- return window;
+ if (!lastWindow_) {
+ lastWindow_ = new QtMainWindow(eventStream, treeWidgetFactory_);
+ }
+ return lastWindow_;
}
MainWindow* QtMainWindowFactory::getLastCreatedWindow() {
- return lastWindow_;
+ assert(lastWindow_);
+ return lastWindow_;;
}
}