diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c
index 6ef49ea813a..860a9a597bb 100644
--- a/dlls/mshtml/conpoint.c
+++ b/dlls/mshtml/conpoint.c
@@ -197,6 +197,19 @@ static void ConnectionPoint_Create(HTMLDocument *doc, REFIID riid, ConnectionPoi
*cp = ret;
}
+static void ConnectionPoint_Destroy(ConnectionPoint *This)
+{
+ int i;
+
+ for(i=0; isinks_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(HTMLDocument *This)
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 a8fe470395a..10081ad3f3d 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -157,6 +157,8 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
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 4c7abe42a4d..ee608de6aea 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -260,6 +260,8 @@ void HTMLDocument_Service_Init(HTMLDocument*);
void HTMLDocument_Hlink_Init(HTMLDocument*);
void HTMLDocument_ConnectionPoints_Init(HTMLDocument*);
+void HTMLDocument_ConnectionPoints_Destroy(HTMLDocument*);
+
NSContainer *NSContainer_Create(HTMLDocument*,NSContainer*);
void NSContainer_Release(NSContainer*);