From a218ab1bbf4f7c343d40c5c8a956cf6a0a769341 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Sep 2017 16:58:38 +0300 Subject: fixes #923 (database panic window in StdMsg) --- src/core/stdmsg/src/msgdialog.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index aa9e5136f7..0913a19ec6 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -299,13 +299,15 @@ void CSrmmWindow::OnDestroy() db_set_dw(hContact, SRMMMOD, "height", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top); NotifyEvent(MSG_WINDOW_EVT_CLOSE); - if (m_hContact && g_dat.bDeleteTempCont) - if (db_get_b(m_hContact, "CList", "NotOnList", 0)) - db_delete_contact(m_hContact); Window_FreeIcon_IcoLib(m_hwnd); CSuper::OnDestroy(); + + // a temporary contact should be destroyed after removing window from the window list to prevent recursion + if (m_hContact && g_dat.bDeleteTempCont) + if (db_get_b(m_hContact, "CList", "NotOnList", 0)) + db_delete_contact(m_hContact); } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3