Commit e2d04d3d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Release ActiveX object interfaces in detach_plugin_host.

parent e7c9e32d
...@@ -893,6 +893,29 @@ static ULONG WINAPI PHClientSite_AddRef(IOleClientSite *iface) ...@@ -893,6 +893,29 @@ static ULONG WINAPI PHClientSite_AddRef(IOleClientSite *iface)
return ref; return ref;
} }
static void release_plugin_ifaces(PluginHost *This)
{
if(This->disp) {
IDispatch_Release(This->disp);
This->disp = NULL;
}
if(This->ip_object) {
IOleInPlaceObject_Release(This->ip_object);
This->ip_object = NULL;
}
if(This->plugin_unk) {
IUnknown *unk = This->plugin_unk;
LONG ref;
This->plugin_unk = NULL;
ref = IUnknown_Release(unk);
TRACE("plugin ref = %d\n", ref);
}
}
static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface) static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface)
{ {
PluginHost *This = impl_from_IOleClientSite(iface); PluginHost *This = impl_from_IOleClientSite(iface);
...@@ -901,10 +924,7 @@ static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface) ...@@ -901,10 +924,7 @@ static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface)
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
if(!ref) { if(!ref) {
if(This->disp) release_plugin_ifaces(This);
IDispatch_Release(This->disp);
if(This->ip_object)
IOleInPlaceObject_Release(This->ip_object);
if(This->sink) { if(This->sink) {
This->sink->host = NULL; This->sink->host = NULL;
IDispatch_Release(&This->sink->IDispatch_iface); IDispatch_Release(&This->sink->IDispatch_iface);
...@@ -913,8 +933,6 @@ static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface) ...@@ -913,8 +933,6 @@ static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface)
list_remove(&This->entry); list_remove(&This->entry);
if(This->element) if(This->element)
This->element->plugin_host = NULL; This->element->plugin_host = NULL;
if(This->plugin_unk)
IUnknown_Release(This->plugin_unk);
heap_free(This); heap_free(This);
} }
...@@ -1687,6 +1705,8 @@ void detach_plugin_host(PluginHost *host) ...@@ -1687,6 +1705,8 @@ void detach_plugin_host(PluginHost *host)
host->sink = NULL; host->sink = NULL;
} }
release_plugin_ifaces(host);
if(host->element) { if(host->element) {
host->element->plugin_host = NULL; host->element->plugin_host = NULL;
host->element = NULL; host->element = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment