From f762367d539d29a36f1b3f797fe851dda2168347 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 5 Feb 2018 23:43:13 +0100 Subject: 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 --- subsurface-desktop-helper.cpp | 8 +++----- 1 file 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); } -- cgit v1.2.3-70-g09d2