Jacek Caban : mshtml: Destroy connection points.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 26 07:13:08 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 7f617230a5bebea3ffec03743be00f3e1a5de75c
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=7f617230a5bebea3ffec03743be00f3e1a5de75c

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sun Jun 25 15:49:39 2006 +0200

mshtml: Destroy connection points.

---

 dlls/mshtml/conpoint.c       |   20 ++++++++++++++++++++
 dlls/mshtml/htmldoc.c        |    2 ++
 dlls/mshtml/mshtml_private.h |    2 ++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c
index 6ef49ea..860a9a5 100644
--- a/dlls/mshtml/conpoint.c
+++ b/dlls/mshtml/conpoint.c
@@ -197,6 +197,19 @@ static void ConnectionPoint_Create(HTMLD
     *cp = ret;
 }
 
+static void ConnectionPoint_Destroy(ConnectionPoint *This)
+{
+    int i;
+
+    for(i=0; i<This->sinks_size; i++) {
+        if(This->sinks[i].unk)
+            IUnknown_Release(This->sinks[i].unk);
+    }
+
+    HeapFree(GetProcessHeap(), 0, This->sinks);
+    HeapFree(GetProcessHeap(), 0, This);
+}
+
 #define CONPTCONT_THIS(iface) DEFINE_THIS(HTMLDocument, ConnectionPointContainer, iface)
 
 static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface,
@@ -271,3 +284,10 @@ void HTMLDocument_ConnectionPoints_Init(
     ConnectionPoint_Create(This, &DIID_HTMLDocumentEvents, &This->cp_htmldocevents);
     ConnectionPoint_Create(This, &DIID_HTMLDocumentEvents2, &This->cp_htmldocevents2);
 }
+
+void HTMLDocument_ConnectionPoints_Destroy(HTMLDocument *This)
+{
+    ConnectionPoint_Destroy(This->cp_propnotif);
+    ConnectionPoint_Destroy(This->cp_htmldocevents);
+    ConnectionPoint_Destroy(This->cp_htmldocevents2);
+}
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index a8fe470..10081ad 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -157,6 +157,8 @@ static ULONG WINAPI HTMLDocument_Release
 
         release_nodes(This);
 
+        HTMLDocument_ConnectionPoints_Destroy(This);
+
         if(This->nscontainer)
             NSContainer_Release(This->nscontainer);
 
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 4c7abe4..ee608de 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -260,6 +260,8 @@ void HTMLDocument_Service_Init(HTMLDocum
 void HTMLDocument_Hlink_Init(HTMLDocument*);
 void HTMLDocument_ConnectionPoints_Init(HTMLDocument*);
 
+void HTMLDocument_ConnectionPoints_Destroy(HTMLDocument*);
+
 NSContainer *NSContainer_Create(HTMLDocument*,NSContainer*);
 void NSContainer_Release(NSContainer*);
 




More information about the wine-cvs mailing list