diff options
author | George Hazan <george.hazan@gmail.com> | 2015-04-30 20:23:03 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-04-30 20:23:03 +0000 |
commit | af683f3f4196c45f130ba10a2d14e89a729b6e52 (patch) | |
tree | 50c5f6aedc9d37f15ca193e1809006a41605aa16 /plugins/Clist_modern/src/modern_skinbutton.cpp | |
parent | 8d39ca21d3d353c20b378687ce2351374cab9521 (diff) |
minor fix for the lock's scope
git-svn-id: http://svn.miranda-ng.org/main/trunk@13321 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_skinbutton.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_skinbutton.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index a16a0a0edf..6d0617bbff 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -369,20 +369,19 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w return TRUE; case WM_DESTROY: - { if (bct == NULL) break; - mir_cslock lck(csTips); + if (hwndToolTips) { - TOOLINFO ti; - memset(&ti, 0, sizeof(ti)); + mir_cslock lck(csTips); + TOOLINFO ti = { 0 }; ti.cbSize = sizeof(ti); ti.uFlags = TTF_IDISHWND; ti.hwnd = bct->hwnd; ti.uId = (UINT_PTR)bct->hwnd; - if (SendMessage(hwndToolTips, TTM_GETTOOLINFO, 0, (LPARAM)&ti)) { + if (SendMessage(hwndToolTips, TTM_GETTOOLINFO, 0, (LPARAM)&ti)) SendMessage(hwndToolTips, TTM_DELTOOL, 0, (LPARAM)&ti); - } + if (SendMessage(hwndToolTips, TTM_GETTOOLCOUNT, 0, (LPARAM)&ti) == 0) { DestroyWindow(hwndToolTips); hwndToolTips = NULL; @@ -397,16 +396,15 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w mir_free(bct->ValueTypeDef); mir_free(bct); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0); - } - break; // DONT! fall thru + break; // DONT! fall thru case WM_SETCURSOR: - { - HCURSOR hCurs1 = LoadCursor(NULL, IDC_ARROW); - if (hCurs1) SetCursor(hCurs1); - if (bct) SetToolTip(hwndDlg, bct->Hint); - } - return 1; + { + HCURSOR hCurs1 = LoadCursor(NULL, IDC_ARROW); + if (hCurs1) SetCursor(hCurs1); + if (bct) SetToolTip(hwndDlg, bct->Hint); + } + return 1; case WM_PRINT: if (IsWindowVisible(hwndDlg)) |