diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-30 06:20:19 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-30 06:20:19 +0000 |
commit | 2926b727b08fafd10e2429dac0efc21505b850e3 (patch) | |
tree | f79b63fae8f9787cd10d6b72621ea82ddb9651e9 /plugins/UserInfoEx/src/ctrl_button.cpp | |
parent | 2f0617376dcb4be5b837c5f888762e4e1ef3aceb (diff) |
minus critical section
git-svn-id: http://svn.miranda-ng.org/main/trunk@13273 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/ctrl_button.cpp')
-rw-r--r-- | plugins/UserInfoEx/src/ctrl_button.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp index 8a85a81947..7bcb7980b6 100644 --- a/plugins/UserInfoEx/src/ctrl_button.cpp +++ b/plugins/UserInfoEx/src/ctrl_button.cpp @@ -45,7 +45,7 @@ typedef struct TMBCtrl{ } BTNCTRL, *LPBTNCTRL;
// External theme methods and properties
-static CRITICAL_SECTION csTips;
+static mir_cs csTips;
static HWND hwndToolTips = NULL;
/**
@@ -379,7 +379,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L }
case WM_DESTROY:
if (bct) {
- EnterCriticalSection(&csTips);
+ mir_cslock lck(csTips);
if (hwndToolTips) {
TOOLINFO ti;
@@ -396,7 +396,6 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L hwndToolTips = NULL;
}
}
- LeaveCriticalSection(&csTips);
DestroyTheme(bct);
mir_free(bct);
}
@@ -508,7 +507,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L break;
case BUTTONADDTOOLTIP:
if (wParam) {
- EnterCriticalSection(&csTips);
+ mir_cslock lck(csTips);
if (!hwndToolTips)
hwndToolTips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandle(NULL), NULL);
@@ -544,7 +543,6 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L ti.lpszText=(LPSTR)wParam;
SendMessage(hwndToolTips, TTM_ADDTOOLA, 0, (LPARAM)&ti);
}
- LeaveCriticalSection(&csTips);
}
break;
case BUTTONTRANSLATE:
@@ -626,7 +624,6 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L void CtrlButtonUnloadModule()
{
- DeleteCriticalSection(&csTips);
UnregisterClass(UINFOBUTTONCLASS, ghInst);
}
@@ -642,6 +639,5 @@ void CtrlButtonLoadModule() wc.cbWndExtra = sizeof(LPBTNCTRL);
wc.style = CS_GLOBALCLASS;
RegisterClassEx(&wc);
- InitializeCriticalSection(&csTips);
}
|