aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-desktop-helper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-02-05 23:43:13 +0100
committerGravatar Jan Mulder <jlmulder@xs4all.nl>2018-02-06 12:30:15 +0100
commitf762367d539d29a36f1b3f797fe851dda2168347 (patch)
treecbbb967e5c891ec338829c7cd767e66d51b26a27 /subsurface-desktop-helper.cpp
parent615307435cc1d0ffba6bc7649a4039f0aba62622 (diff)
downloadsubsurface-f762367d539d29a36f1b3f797fe851dda2168347.tar.gz
Cleanup: don't keep static variable of MainWindow
MainWindow is a "singleton" and has an instance() member function. No point in keeping a second static pointer in subsurface-desktop-helper.cpp. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'subsurface-desktop-helper.cpp')
-rw-r--r--subsurface-desktop-helper.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/subsurface-desktop-helper.cpp b/subsurface-desktop-helper.cpp
index d2c4aeebd..e902a5946 100644
--- a/subsurface-desktop-helper.cpp
+++ b/subsurface-desktop-helper.cpp
@@ -14,27 +14,25 @@
#include "core/qt-gui.h"
-static MainWindow *window = NULL;
-
void init_ui()
{
init_qt_late();
PluginManager::instance().loadPlugins();
- window = new MainWindow();
+ MainWindow *window = new MainWindow();
window->setTitle();
}
void run_ui()
{
- window->show();
+ MainWindow::instance()->show();
qApp->exec();
}
void exit_ui()
{
- delete window;
+ delete MainWindow::instance();
delete qApp;
free((void *)existing_filename);
}