summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/msgwindow.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-16 21:40:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-16 21:40:14 +0000
commit831ad8a0121f9f9ee5c4f38d4a0d209b3c2bdb60 (patch)
treee362f0459b19341b213e5ca7de87af699564beab /plugins/Scriver/src/msgwindow.cpp
parent41ba18e9cb1c340cb80c637817231b487c54562e (diff)
kernel chats, part 3, tabsrmm
git-svn-id: http://svn.miranda-ng.org/main/trunk@7684 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src/msgwindow.cpp')
-rw-r--r--plugins/Scriver/src/msgwindow.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp
index b791a24541..18706d3c9b 100644
--- a/plugins/Scriver/src/msgwindow.cpp
+++ b/plugins/Scriver/src/msgwindow.cpp
@@ -828,13 +828,14 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case WM_DESTROY:
{
char szSettingName[64];
- for (int i=dat->childrenCount; --i >= 0;) {
+ for (int i = dat->childrenCount; i >= 0; i--) {
TCITEM tci;
tci.mask = TCIF_PARAM | TCIF_IMAGE;
- TabCtrl_GetItem(dat->hwndTabs, i, &tci);
- TabCtrl_DeleteItem(dat->hwndTabs, i);
- mir_free((MessageWindowTabData *) tci.lParam);
- ReleaseIcon(tci.iImage);
+ if (TabCtrl_GetItem(dat->hwndTabs, i, &tci)) {
+ mir_free((MessageWindowTabData *)tci.lParam);
+ ReleaseIcon(tci.iImage);
+ TabCtrl_DeleteItem(dat->hwndTabs, i);
+ }
}
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
WindowList_Remove(g_dat.hParentWindowList, hwndDlg);