summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-17 14:22:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-17 14:22:17 +0000
commit15267ea2d489606fb4b99d011bc3ea7c2a644a9f (patch)
tree607fb948632ec8b348508cbd08ef41fffe21d8c2 /include
parent5e6e1e8838fe7637ef588e0fb080ad07fc5700aa (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 'include')
-rw-r--r--include/delphi/m_popup.inc1
-rw-r--r--include/m_popup.h17
2 files changed, 17 insertions, 1 deletions
diff --git a/include/delphi/m_popup.inc b/include/delphi/m_popup.inc
index 0a47fccba4..4e870963f4 100644
--- a/include/delphi/m_popup.inc
+++ b/include/delphi/m_popup.inc
@@ -336,6 +336,7 @@ const
// wParam = 0
// lParam = (POPUPCLASS *)&pc
MS_POPUP_REGISTERCLASS = 'PopUp/RegisterClass';
+ MS_POPUP_UNREGISTERCLASS = 'PopUp/UnregisterClass';
type
TPOPUPDATACLASS = record
diff --git a/include/m_popup.h b/include/m_popup.h
index b715345c40..1a633ac14b 100644
--- a/include/m_popup.h
+++ b/include/m_popup.h
@@ -332,7 +332,22 @@ typedef struct {
// wParam = 0
// lParam = (POPUPCLASS *)&pc
-#define MS_POPUP_REGISTERCLASS "PopUp/RegisterClass"
+#define MS_POPUP_REGISTERCLASS "PopUp/RegisterClass"
+
+HANDLE __forceinline Popup_RegisterClass(POPUPCLASS *pc)
+{
+ if ( !ServiceExists(MS_POPUP_REGISTERCLASS))
+ return NULL;
+ return (HANDLE)CallService(MS_POPUP_REGISTERCLASS, 0, LPARAM(pc));
+}
+
+#define MS_POPUP_UNREGISTERCLASS "PopUp/UnregisterClass"
+
+void __forceinline Popup_UnregisterClass(HANDLE ppc)
+{
+ if (ppc)
+ CallService(MS_POPUP_UNREGISTERCLASS, 0, LPARAM(ppc));
+}
typedef struct {
int cbSize;