From cdc121346620d6509a0b8c6483d7f228c6e89861 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 21 Aug 2013 12:13:17 +0000 Subject: tabSRMM: thy shall not create a container after shutdown git-svn-id: http://svn.miranda-ng.org/main/trunk@5771 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/chat/services.cpp | 6 ++++-- plugins/TabSRMM/src/chat/window.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'plugins/TabSRMM/src/chat') diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index e346526e08..60ca0f1ea4 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -418,7 +418,8 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT TCHAR szName[CONTAINER_NAMELEN + 1]; mir_sntprintf(szName, CONTAINER_NAMELEN, _T("default")); - pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact); + if ((pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact)) == NULL) + return 0; } } @@ -565,7 +566,8 @@ void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground) } if (pContainer == NULL) pContainer = CreateContainer(szName, FALSE, si->hContact); - si->hWnd = CreateNewRoom(pContainer, si, TRUE, TRUE, FALSE); + if (pContainer) + si->hWnd = CreateNewRoom(pContainer, si, TRUE, TRUE, FALSE); } INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 7ba1c799db..01dac55bef 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -3361,7 +3361,8 @@ LABEL_SHOWWINDOW: break; pNewContainer = FindContainerByName(szNewName); if (pNewContainer == NULL) - pNewContainer = CreateContainer(szNewName, FALSE, dat->hContact); + if ((pNewContainer = CreateContainer(szNewName, FALSE, dat->hContact)) == NULL) + break; db_set_ts(dat->hContact, SRMSGMOD_T, "containerW", szNewName); PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_DOCREATETAB_CHAT, (WPARAM)pNewContainer, (LPARAM)hwndDlg); if (iOldItems > 1) // there were more than 1 tab, container is still valid -- cgit v1.2.3