diff --git a/qt/mainwindow.cpp b/qt/mainwindow.cpp index 1aa9369c94..a385e7ec76 100644 --- a/qt/mainwindow.cpp +++ b/qt/mainwindow.cpp @@ -143,6 +143,10 @@ bool MainWindow::winEvent(MSG * msg, long * result) MainWindow::~MainWindow() { SaveState(); +#ifndef NO_DOWNLOADER + if (m_updateDialog) + m_updateDialog->DetachFromStorage(); +#endif } void MainWindow::SaveState() diff --git a/qt/update_dialog.cpp b/qt/update_dialog.cpp index 722648bd1b..f1d850a29c 100644 --- a/qt/update_dialog.cpp +++ b/qt/update_dialog.cpp @@ -88,7 +88,7 @@ namespace qt bind(&UpdateDialog::OnCountryDownloadProgress, this, _1, _2)); } - UpdateDialog::~UpdateDialog() + void UpdateDialog::DetachFromStorage() { // tell download manager that we're gone... m_storage.Unsubscribe(m_observerSlotId); diff --git a/qt/update_dialog.hpp b/qt/update_dialog.hpp index 6d788ee028..0932ff47ed 100644 --- a/qt/update_dialog.hpp +++ b/qt/update_dialog.hpp @@ -17,7 +17,6 @@ namespace qt public: explicit UpdateDialog(QWidget * parent, storage::Storage & storage); - ~UpdateDialog(); /// @name Called from downloader to notify GUI //@{ @@ -28,6 +27,8 @@ namespace qt void ShowModal(); + void DetachFromStorage(); + private slots: void OnItemClick(QTreeWidgetItem * item, int column); void OnCloseClick();