diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-02-05 23:43:13 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2018-02-06 12:30:15 +0100 |
commit | f762367d539d29a36f1b3f797fe851dda2168347 (patch) | |
tree | cbbb967e5c891ec338829c7cd767e66d51b26a27 /subsurface-desktop-helper.cpp | |
parent | 615307435cc1d0ffba6bc7649a4039f0aba62622 (diff) | |
download | subsurface-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.cpp | 8 |
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); } |