Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qt
diff options
context:
space:
mode:
authorrachytski <siarhei.rachytski@gmail.com>2012-06-02 21:25:02 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:39:20 +0300
commit21b63475a7383bb2a0e4f0f0d57c3b5fb995fc27 (patch)
treefd466f5525554db6c8daa87668e10a89e140e66c /qt
parent3ce36452105111e05ef575a00036807428dd5cf5 (diff)
fixed access violation into Storage::Unsubscribe upon deletion of UpdateDialog.
Diffstat (limited to 'qt')
-rw-r--r--qt/mainwindow.cpp4
-rw-r--r--qt/update_dialog.cpp2
-rw-r--r--qt/update_dialog.hpp3
3 files changed, 7 insertions, 2 deletions
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();