diff --git a/qt/update_dialog.cpp b/qt/update_dialog.cpp index b5057178be..cf9c06ed39 100644 --- a/qt/update_dialog.cpp +++ b/qt/update_dialog.cpp @@ -57,7 +57,9 @@ namespace qt //////////////////////////////////////////////////////////////////////////////// UpdateDialog::UpdateDialog(QWidget * parent, Storage & storage) - : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), m_storage(storage) + : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), + m_storage(storage), + m_observerSlotId(0) { setWindowModality(Qt::WindowModal); @@ -85,14 +87,14 @@ namespace qt resize(600, 500); // we want to receive all download progress and result events - m_storage.Subscribe(bind(&UpdateDialog::OnCountryChanged, this, _1), - bind(&UpdateDialog::OnCountryDownloadProgress, this, _1, _2)); + m_observerSlotId = m_storage.Subscribe(bind(&UpdateDialog::OnCountryChanged, this, _1), + bind(&UpdateDialog::OnCountryDownloadProgress, this, _1, _2)); } UpdateDialog::~UpdateDialog() { // tell download manager that we're gone... - m_storage.Unsubscribe(); + m_storage.Unsubscribe(m_observerSlotId); } /// when user clicks on any map row in the table diff --git a/qt/update_dialog.hpp b/qt/update_dialog.hpp index ae44adbcf7..12a061b1f1 100644 --- a/qt/update_dialog.hpp +++ b/qt/update_dialog.hpp @@ -39,5 +39,6 @@ namespace qt private: QTreeWidget * m_tree; storage::Storage & m_storage; + int m_observerSlotId; }; } // namespace qt