From a4b442beef67e204c99d75e561ec9577d58ddf40 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Mar 2013 13:48:48 +0000 Subject: removed endless loop in YAPP git-svn-id: http://svn.miranda-ng.org/main/trunk@4094 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/YAPP/src/popwin.cpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'plugins/YAPP/src/popwin.cpp') diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp index 0313ba6f30..cbc7eb8139 100644 --- a/plugins/YAPP/src/popwin.cpp +++ b/plugins/YAPP/src/popwin.cpp @@ -131,15 +131,16 @@ void AddWindowToStack(HWND hwnd) { RepositionWindows(); } -void RemoveWindowFromStack(HWND hwnd) { +void RemoveWindowFromStack(HWND hwnd) +{ HWNDStackNode *current = hwnd_stack_top, *prev = 0; while(current) { if (current->hwnd == hwnd) { - if (prev) { + if (prev) prev->next = current->next; - } else { + else hwnd_stack_top = current->next; - } + mir_free(current); stack_size--; break; @@ -149,19 +150,24 @@ void RemoveWindowFromStack(HWND hwnd) { current = current->next; } - if (hwnd_stack_top) RepositionWindows(); + if (hwnd_stack_top) + RepositionWindows(); } -void ClearStack() { - while(hwnd_stack_top) { - DestroyWindow(hwnd_stack_top->hwnd); +void BroadcastMessage(UINT msg, WPARAM wParam, LPARAM lParam) +{ + HWNDStackNode *current = hwnd_stack_top; + while(current) { + SendMessage(current->hwnd, msg, wParam, lParam); + current = current->next; } } -void BroadcastMessage(UINT msg, WPARAM wParam, LPARAM lParam) { +void DeinitWindowStack() +{ HWNDStackNode *current = hwnd_stack_top; while(current) { - SendMessage(current->hwnd, msg, wParam, lParam); + DestroyWindow(current->hwnd); current = current->next; } } @@ -729,17 +735,10 @@ void InitWindowStack() MySetLayeredWindowAttributes = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(hUserDll, "SetLayeredWindowAttributes"); MyAnimateWindow=(BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(hUserDll,"AnimateWindow"); MyMonitorFromRect=(HMONITOR (WINAPI*)(LPCRECT,DWORD))GetProcAddress(hUserDll, "MonitorFromRect"); - - MyGetMonitorInfo=(BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfoW"); - + MyGetMonitorInfo=(BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfoW"); } } -void DeinitWindowStack() -{ - ClearStack(); -} - /////////////////////////////////////////////////////////////////////////////// void PopupData::SetIcon(HICON hNewIcon) -- cgit v1.2.3