diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-17 14:22:17 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-17 14:22:17 +0000 |
commit | 15267ea2d489606fb4b99d011bc3ea7c2a644a9f (patch) | |
tree | 607fb948632ec8b348508cbd08ef41fffe21d8c2 /protocols/Gadu-Gadu | |
parent | 5e6e1e8838fe7637ef588e0fb080ad07fc5700aa (diff) |
fix for popup-related memory leaks
git-svn-id: http://svn.miranda-ng.org/main/trunk@4077 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.cpp | 3 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.h | 1 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/popups.cpp | 8 |
3 files changed, 7 insertions, 5 deletions
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index f753f2a863..af082ae1f3 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -93,6 +93,9 @@ GGPROTO::~GGPROTO() keepalive_destroy();
gc_destroy();
+ Popup_UnregisterClass(hPopupError);
+ Popup_UnregisterClass(hPopupNotify);
+
if (hMenuRoot)
CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)hMenuRoot, 0);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h index 6bb5a1565c..d462f420f3 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.h +++ b/protocols/Gadu-Gadu/src/gg_proto.h @@ -286,6 +286,7 @@ struct GGPROTO : public PROTO_INTERFACE HANDLE hAvatarsFolder;
HANDLE hImagesFolder;
HWND hwndSessionsDlg;
+ HANDLE hPopupNotify, hPopupError;
};
typedef struct
diff --git a/protocols/Gadu-Gadu/src/popups.cpp b/protocols/Gadu-Gadu/src/popups.cpp index 386435c973..fcd58ea3e9 100644 --- a/protocols/Gadu-Gadu/src/popups.cpp +++ b/protocols/Gadu-Gadu/src/popups.cpp @@ -79,9 +79,9 @@ void GGPROTO::initpopups() puc.cbSize = sizeof(puc);
puc.PluginWindowProc = PopupWindowProc;
puc.flags = PCF_TCHAR;
-
puc.ptszDescription = szDescr;
puc.pszName = szName;
+
puc.colorBack = RGB(173, 206, 247);
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
puc.hIcon = CopyIcon(LoadIconEx("main", FALSE));
@@ -89,17 +89,15 @@ void GGPROTO::initpopups() puc.iSeconds = 4;
mir_sntprintf(szDescr, SIZEOF(szDescr), _T("%s/%s"), m_tszUserName, TranslateT("Notify"));
mir_snprintf(szName, SIZEOF(szName), "%s_%s", m_szModuleName, "Notify");
- CallService(MS_POPUP_REGISTERCLASS, 0, (WPARAM)&puc);
+ hPopupNotify = Popup_RegisterClass(&puc);
- puc.ptszDescription = szDescr;
- puc.pszName = szName;
puc.colorBack = RGB(191, 0, 0); // Red
puc.colorText = RGB(255, 245, 225); // Yellow
puc.iSeconds = 60;
puc.hIcon = (HICON)LoadImage(NULL, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED);
mir_sntprintf(szDescr, SIZEOF(szDescr), _T("%s/%s"), m_tszUserName, TranslateT("Error"));
mir_snprintf(szName, SIZEOF(szName), "%s_%s", m_szModuleName, "Error");
- CallService(MS_POPUP_REGISTERCLASS, 0, (WPARAM)&puc);
+ hPopupError = Popup_RegisterClass(&puc);
}
/////////////////////////////////////////////////////////////////////////////////////////
|