Commit 98db6a0d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Move cycle collection to detach_gecko_browser.

parent 96604df6
......@@ -5300,11 +5300,6 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface)
TRACE("(%p) ref = %u\n", This, ref);
if(!ref) {
nsIDOMWindowUtils *window_utils = NULL;
if(This->basedoc.window && This->basedoc.window->nswindow)
get_nsinterface((nsISupports*)This->basedoc.window->nswindow, &IID_nsIDOMWindowUtils, (void**)&window_utils);
if(This->basedoc.doc_node) {
This->basedoc.doc_node->basedoc.doc_obj = NULL;
htmldoc_release(&This->basedoc.doc_node->basedoc);
......@@ -5344,12 +5339,6 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface)
if(This->nscontainer)
detach_gecko_browser(This->nscontainer);
heap_free(This);
/* Force cycle collection */
if(window_utils) {
nsIDOMWindowUtils_CycleCollect(window_utils, NULL, 0);
nsIDOMWindowUtils_Release(window_utils);
}
}
return ref;
......
......@@ -2181,11 +2181,15 @@ HRESULT create_gecko_browser(HTMLDocumentObj *doc, GeckoBrowser **_ret)
void detach_gecko_browser(GeckoBrowser *This)
{
nsIDOMWindowUtils *window_utils = NULL;
TRACE("(%p)\n", This);
This->doc = NULL;
if(This->content_window) {
get_nsinterface((nsISupports*)This->content_window->nswindow, &IID_nsIDOMWindowUtils, (void**)&window_utils);
IHTMLWindow2_Release(&This->content_window->base.IHTMLWindow2_iface);
This->content_window = NULL;
}
......@@ -2243,6 +2247,12 @@ void detach_gecko_browser(GeckoBrowser *This)
}
nsIWebBrowserChrome_Release(&This->nsIWebBrowserChrome_iface);
/* Force cycle collection */
if(window_utils) {
nsIDOMWindowUtils_CycleCollect(window_utils, NULL, 0);
nsIDOMWindowUtils_Release(window_utils);
}
}
/*
......
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