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

mshtml: Detach more document objects in detach_inner_window.

parent eca21a38
...@@ -4885,31 +4885,39 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -4885,31 +4885,39 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
return S_OK; return S_OK;
} }
static void HTMLDocumentNode_destructor(HTMLDOMNode *iface) void detach_document_node(HTMLDocumentNode *doc)
{ {
HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
unsigned i; unsigned i;
for(i=0; i < This->elem_vars_cnt; i++) while(!list_empty(&doc->plugin_hosts))
heap_free(This->elem_vars[i]); detach_plugin_host(LIST_ENTRY(list_head(&doc->plugin_hosts), PluginHost, entry));
heap_free(This->elem_vars);
detach_events(This); detach_events(doc);
if(This->catmgr) detach_selection(doc);
ICatInformation_Release(This->catmgr); detach_ranges(doc);
detach_selection(This); for(i=0; i < doc->elem_vars_cnt; i++)
detach_ranges(This); heap_free(doc->elem_vars[i]);
heap_free(doc->elem_vars);
doc->elem_vars_cnt = 0;
while(!list_empty(&This->plugin_hosts)) if(doc->catmgr) {
detach_plugin_host(LIST_ENTRY(list_head(&This->plugin_hosts), PluginHost, entry)); ICatInformation_Release(doc->catmgr);
doc->catmgr = NULL;
}
if(!This->nsdoc && This->window) { if(!doc->nsdoc && doc->window) {
/* document fragments own reference to inner window */ /* document fragments own reference to inner window */
IHTMLWindow2_Release(&This->window->base.IHTMLWindow2_iface); IHTMLWindow2_Release(&doc->window->base.IHTMLWindow2_iface);
This->window = NULL; doc->window = NULL;
} }
}
static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
{
HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
detach_document_node(This);
heap_free(This->event_vector); heap_free(This->event_vector);
ConnectionPointContainer_Destroy(&This->basedoc.cp_container); ConnectionPointContainer_Destroy(&This->basedoc.cp_container);
} }
......
...@@ -126,15 +126,13 @@ static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIAN ...@@ -126,15 +126,13 @@ static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIAN
static void detach_inner_window(HTMLInnerWindow *window) static void detach_inner_window(HTMLInnerWindow *window)
{ {
HTMLOuterWindow *outer_window = window->base.outer_window; HTMLOuterWindow *outer_window = window->base.outer_window;
HTMLDocumentNode *doc = window->doc;
if(outer_window && outer_window->doc_obj && outer_window == outer_window->doc_obj->basedoc.window) if(outer_window && outer_window->doc_obj && outer_window == outer_window->doc_obj->basedoc.window)
window->doc->basedoc.cp_container.forward_container = NULL; window->doc->basedoc.cp_container.forward_container = NULL;
if(window->doc) { if(doc)
detach_events(window->doc); detach_document_node(doc);
while(!list_empty(&window->doc->plugin_hosts))
detach_plugin_host(LIST_ENTRY(list_head(&window->doc->plugin_hosts), PluginHost, entry));
}
abort_window_bindings(window); abort_window_bindings(window);
remove_target_tasks(window->task_magic); remove_target_tasks(window->task_magic);
......
...@@ -975,6 +975,7 @@ HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**) DECL ...@@ -975,6 +975,7 @@ HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**) DECL
IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet*) DECLSPEC_HIDDEN; IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet*) DECLSPEC_HIDDEN;
IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*) DECLSPEC_HIDDEN; IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*) DECLSPEC_HIDDEN;
void detach_document_node(HTMLDocumentNode*) DECLSPEC_HIDDEN;
void detach_selection(HTMLDocumentNode*) DECLSPEC_HIDDEN; void detach_selection(HTMLDocumentNode*) DECLSPEC_HIDDEN;
void detach_ranges(HTMLDocumentNode*) DECLSPEC_HIDDEN; void detach_ranges(HTMLDocumentNode*) DECLSPEC_HIDDEN;
HRESULT get_node_text(HTMLDOMNode*,BSTR*) DECLSPEC_HIDDEN; HRESULT get_node_text(HTMLDOMNode*,BSTR*) DECLSPEC_HIDDEN;
......
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