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/MSN | |
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/MSN')
-rw-r--r-- | protocols/MSN/src/msn_misc.cpp | 16 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.cpp | 4 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.h | 4 |
3 files changed, 11 insertions, 13 deletions
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index e6b86d244f..f39fe781c0 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -974,33 +974,27 @@ void CMsnProto::InitPopups(void) TCHAR desc[256];
char name[256];
- POPUPCLASS ppc = {0};
- ppc.cbSize = sizeof(ppc);
+ POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
ppc.PluginWindowProc = NullWindowProc;
-
ppc.hIcon = LoadIconEx("main");
-
ppc.ptszDescription = desc;
ppc.pszName = name;
+
ppc.colorBack = RGB(173, 206, 247);
ppc.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppc.iSeconds = 3;
mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Hotmail"));
mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Hotmail");
- CallService(MS_POPUP_REGISTERCLASS, 0, (WPARAM)&ppc);
+ hPopupHotmail = Popup_RegisterClass(&ppc);
- ppc.ptszDescription = desc;
- ppc.pszName = name;
ppc.colorBack = RGB(173, 206, 247);
ppc.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppc.iSeconds = 3;
mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Notify"));
mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notify");
- CallService(MS_POPUP_REGISTERCLASS, 0, (WPARAM)&ppc);
+ hPopupNotify = Popup_RegisterClass(&ppc);
- ppc.ptszDescription = desc;
- ppc.pszName = name;
ppc.hIcon = (HICON)LoadImage(NULL, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED);
ppc.colorBack = RGB(191, 0, 0); //Red
ppc.colorText = RGB(255, 245, 225); //Yellow
@@ -1008,7 +1002,7 @@ void CMsnProto::InitPopups(void) mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Error"));
mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error");
- CallService(MS_POPUP_REGISTERCLASS, 0, (WPARAM)&ppc);
+ hPopupError = Popup_RegisterClass(&ppc);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 5b9872f84a..c1ed5e4f56 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -227,6 +227,10 @@ int CMsnProto::OnModulesLoaded(WPARAM, LPARAM) int CMsnProto::OnPreShutdown(WPARAM, LPARAM)
{
SetEvent(hevAvatarQueue);
+
+ Popup_UnregisterClass(hPopupError);
+ Popup_UnregisterClass(hPopupHotmail);
+ Popup_UnregisterClass(hPopupNotify);
return 0;
}
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index e572663f0d..b9819eb099 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -187,10 +187,10 @@ struct CMsnProto : public PROTO_INTERFACE clock_t mStatusMsgTS;
HANDLE msnSearchId;
- HANDLE hNetlibUser;
- HANDLE hNetlibUserHttps;
+ HANDLE hNetlibUser, hNetlibUserHttps;
HANDLE hHttpsConnection;
HANDLE hMSNNudge;
+ HANDLE hPopupError, hPopupHotmail, hPopupNotify;
HANDLE hMSNAvatarsFolder;
HANDLE hCustomSmileyFolder;
|