From 3e2322e7e0fae1fc67018015b193b1f494ee7315 Mon Sep 17 00:00:00 2001 From: Jussi Laitinen Date: Tue, 16 Nov 2010 14:17:58 +0200 Subject: [PATCH] Fixed seg fault on logout. --- src/ui/mainwindow.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 8c93369..8a0ea5a 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -77,8 +77,7 @@ MainWindow::MainWindow(QWidget *parent) m_crosshair(0), m_fullScreenButton(0), m_indicatorButtonPanel(0), - m_mapScale(0), - m_updateLocationController(0) + m_mapScale(0) { qDebug() << __PRETTY_FUNCTION__; @@ -114,6 +113,12 @@ MainWindow::MainWindow(QWidget *parent) #ifdef Q_WS_MAEMO_5 setAttribute(Qt::WA_Maemo5StackedWindow); #endif + + m_updateLocationController = new UpdateLocation(this); + + connect(this, SIGNAL(updateWasSuccessful()), m_updateLocationController, SLOT(clear())); + connect(m_updateLocationController, SIGNAL(locationUpdate(QString,bool)), + this, SIGNAL(locationUpdate(QString,bool))); } MainWindow::~MainWindow() @@ -824,16 +829,6 @@ void MainWindow::showUpdateLocationDialog() { qDebug() << __PRETTY_FUNCTION__; - if (!m_updateLocationController) { - m_updateLocationController = new UpdateLocation(this); - if (!m_updateLocationController) - return; - else - connect(this, SIGNAL(updateWasSuccessful()), m_updateLocationController, SLOT(clear())); - connect(m_updateLocationController, SIGNAL(locationUpdate(QString,bool)), - this, SIGNAL(locationUpdate(QString,bool))); - } - UpdateLocationDialog *updateLocationDialog = new UpdateLocationDialog(m_updateLocationController, this); -- 1.7.9.5