summaryrefslogtreecommitdiff
path: root/src/modules/clist/clc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-19 18:42:19 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-19 18:42:19 +0000
commit3d3a8bb209b190732f8530f3dc5b2baa46d3078e (patch)
tree28afcae563cff29fdd686e1a4874bda0f6aee801 /src/modules/clist/clc.cpp
parentd67f238b33aa9fae3e877dc579ac9260323219fe (diff)
fix against recursions in clists
git-svn-id: http://svn.miranda-ng.org/main/trunk@8664 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist/clc.cpp')
-rw-r--r--src/modules/clist/clc.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp
index 0592f10ffb..7d44e89fc8 100644
--- a/src/modules/clist/clc.cpp
+++ b/src/modules/clist/clc.cpp
@@ -33,7 +33,7 @@ void UninitCustomMenus(void);
void MTG_OnmodulesLoad(void);
-static BOOL bModuleInitialized = FALSE;
+static bool bModuleInitialized = false;
static HANDLE hClcWindowList;
static HANDLE hShowInfoTipEvent;
HANDLE hHideInfoTipEvent;
@@ -43,6 +43,12 @@ int g_IconWidth, g_IconHeight;
void FreeDisplayNameCache(void);
+void fnInitAutoRebuild(HWND hWnd)
+{
+ if (!cli.bAutoRebuild && hWnd)
+ cli.bAutoRebuild = PostMessage(hWnd, CLM_AUTOREBUILD, 0, 0) != 0;
+}
+
void fnClcBroadcast(int msg, WPARAM wParam, LPARAM lParam)
{
WindowList_Broadcast(hClcWindowList, msg, wParam, lParam);
@@ -208,7 +214,7 @@ static void SortClcByTimer(HWND hwnd)
int LoadCLCModule(void)
{
- bModuleInitialized = TRUE;
+ bModuleInitialized = true;
g_IconWidth = GetSystemMetrics(SM_CXSMICON);
g_IconHeight = GetSystemMetrics(SM_CYSMICON);
@@ -236,7 +242,8 @@ int LoadCLCModule(void)
void UnloadClcModule()
{
- if (!bModuleInitialized) return;
+ if (!bModuleInitialized)
+ return;
for (int i = 0; i < arEvents.getCount(); i++)
UnhookEvent(arEvents[i]);
@@ -442,7 +449,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
case INTM_NAMEORDERCHANGED:
- PostMessage(hwnd, CLM_AUTOREBUILD, 0, 0);
+ cli.pfnInitAutoRebuild(hwnd);
break;
case INTM_CONTACTADDED: