From ee2e419778605a5445474a33a29f2cfbb7eed245 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 17 Jul 2012 08:35:51 +0000 Subject: bunch of fixes for various memory-related problems git-svn-id: http://svn.miranda-ng.org/main/trunk@1001 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/YAPP/popwin.cpp | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'plugins/YAPP/popwin.cpp') diff --git a/plugins/YAPP/popwin.cpp b/plugins/YAPP/popwin.cpp index 50e99cdd36..682a3f7b05 100644 --- a/plugins/YAPP/popwin.cpp +++ b/plugins/YAPP/popwin.cpp @@ -523,6 +523,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa //} } return 0; + case WM_DESTROY: if(pwd->mouse_in) global_mouse_in--; @@ -546,8 +547,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } mir_free(pwd); pwd = 0; pd = 0; SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); - break; + case PUM_UPDATERGN: // round corners if(pwd->is_round) { @@ -566,32 +567,24 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa return TRUE; case PUM_MOVE: - { - if(options.animate) { - KillTimer(hwnd, ID_MOVETIMER); - pwd->new_x = (int)wParam; - pwd->new_y = (int)lParam; - SetTimer(hwnd, ID_MOVETIMER, 10, 0); - } else { - SetWindowPos(hwnd, 0, (int)wParam, (int)lParam, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); - if (!IsWindowVisible(hwnd)) { - ShowWindow(hwnd, SW_SHOWNOACTIVATE); - UpdateWindow(hwnd); - } + if(options.animate) { + KillTimer(hwnd, ID_MOVETIMER); + pwd->new_x = (int)wParam; + pwd->new_y = (int)lParam; + SetTimer(hwnd, ID_MOVETIMER, 10, 0); + } else { + SetWindowPos(hwnd, 0, (int)wParam, (int)lParam, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); + if (!IsWindowVisible(hwnd)) { + ShowWindow(hwnd, SW_SHOWNOACTIVATE); + UpdateWindow(hwnd); } } return TRUE; + case PUM_SETTEXT: - { - mir_free(pd->pszText); - if(lParam) - pd->pwzText = mir_wstrdup((wchar_t *)lParam); - else - pd->pwzText = NULL; - // mir_free((void *)lParam); // freed in message pump in case the window has gone - InvalidateRect(hwnd, 0, TRUE); - RepositionWindows(); - } + replaceStrT(pd->ptzText, (TCHAR*)lParam); + InvalidateRect(hwnd, 0, TRUE); + RepositionWindows(); return TRUE; case PUM_GETCONTACT: -- cgit v1.2.3