diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2006-12-09 11:19:36 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2006-12-09 11:19:36 +0000 |
commit | 5aab2f53c4b6062a125cbe5242992efad0ff68ef (patch) | |
tree | 71f93fe514c77303e0fe5a5d568a574fae938707 /tipper/popwin.cpp | |
parent | f8f8072f5195d00bdd8967f291c680643659d919 (diff) |
memory leaks and dc font reset (thx George)
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@70 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'tipper/popwin.cpp')
-rw-r--r-- | tipper/popwin.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tipper/popwin.cpp b/tipper/popwin.cpp index bddb175..d0f8055 100644 --- a/tipper/popwin.cpp +++ b/tipper/popwin.cpp @@ -310,6 +310,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa HDC hdc = ps.hdc; GetClientRect(hwnd, &r); r2 = r; + HFONT hOldFont = (HFONT)GetCurrentObject(hdc,OBJ_FONT); // text background //SetBkColor(ps.hdc, options.bg_col); @@ -458,6 +459,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } } + SelectObject(hdc, hOldFont); EndPaint(hwnd, &ps); //} } @@ -528,6 +530,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa DBWriteContactSettingTString(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR*)lParam); SendMessage(hwnd, PUM_REFRESH_VALUES, 0, 0); } + if(lParam) free((void *)lParam); } return TRUE; case PUM_SETAVATAR: @@ -605,6 +608,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa r.top = r.left = 0; r.right = options.win_width; int width = options.padding; + HFONT hOldFont = (HFONT)GetCurrentObject(hdc,OBJ_FONT); // titlebar height if(!pwd->text_tip && pwd->swzTitle && options.title_layout != PTL_NOTITLE) { @@ -700,6 +704,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } } + SelectObject(hdc, hOldFont); ReleaseDC(hwnd, hdc); int height = max(pwd->tb_height + pwd->text_height + options.padding, pwd->av_height); |