From 2e8ecee52cda3e486fe1f1290163735b894a9025 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 14 Apr 2017 12:34:19 +0300 Subject: fixes various crashes on exit in StdMsg --- src/core/stdmsg/src/chat_window.cpp | 4 ++++ src/core/stdmsg/src/msgdialog.cpp | 4 ++++ src/core/stdmsg/src/msgs.cpp | 2 +- src/core/stdmsg/src/msgs.h | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index b51d4cff1a..7eee70faef 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -1191,6 +1191,10 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SetFocus(m_message.GetHwnd()); break; + case DM_CLOSETAB: + CloseTab(); + break; + case DM_CASCADENEWWINDOW: if ((HWND)wParam != m_pOwner->GetHwnd()) { RECT rcThis, rcNew; diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 3964004faa..675f0b7484 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1411,6 +1411,10 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } break; + case DM_CLOSETAB: + CloseTab(); + break; + case DM_STATUSICONCHANGE: SendMessage(m_pOwner->m_hwndStatus, SB_SETTEXT, (SBT_OWNERDRAW | (SendMessage(m_pOwner->m_hwndStatus, SB_GETPARTS, 0, 0) - 1)), 0); break; diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 5944e33f7d..b335fe6c80 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -444,7 +444,7 @@ static int SplitmsgModulesLoaded(WPARAM, LPARAM) int PreshutdownSendRecv(WPARAM, LPARAM) { - Srmm_Broadcast(WM_CLOSE, 0, 0); + Srmm_Broadcast(DM_CLOSETAB, 0, 0); DeinitStatusIcons(); return 0; diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index f1f84714fa..fea335010a 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define HM_DBEVENTADDED (WM_USER+12) #define DM_CASCADENEWWINDOW (WM_USER+13) #define DM_OPTIONSAPPLIED (WM_USER+14) +#define DM_CLOSETAB (WM_USER+15) #define DM_UPDATETITLE (WM_USER+16) #define DM_APPENDTOLOG (WM_USER+17) #define DM_NEWTIMEZONE (WM_USER+18) -- cgit v1.2.3