summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-15 19:07:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-15 19:07:01 +0300
commit7cd2b67ef130a3c60192133d946a22e47cbeec6c (patch)
treee2adc01d5d517f7d5ebc48e62754652c93b76e8b /src/mir_core
parentb225a055f5d3abc754899d115582f39cc2168f3f (diff)
fixes #747 (crash in options during SRMM plugin unload)
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/ui_utils.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp
index 20b2a34140..2c05d41c8a 100644
--- a/src/mir_core/src/ui_utils.cpp
+++ b/src/mir_core/src/ui_utils.cpp
@@ -67,6 +67,7 @@ CDlgBase::CDlgBase(HINSTANCE hInst, int idDialog)
CDlgBase::~CDlgBase()
{
+ m_initialized = false; // prevent double call of destructor
if (m_hwnd)
DestroyWindow(m_hwnd);
}
@@ -259,10 +260,12 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
arDialogs.remove(idx);
}
m_hwnd = NULL;
- if (m_isModal)
- m_isModal = false;
- else // modeless dialogs MUST be allocated with 'new'
- delete this;
+ if (m_initialized) {
+ if (m_isModal)
+ m_isModal = false;
+ else // modeless dialogs MUST be allocated with 'new'
+ delete this;
+ }
return TRUE;
}