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

mshtml: Use detach_inner_window in release_inner_window.

parent 75994335
...@@ -1312,8 +1312,10 @@ void detach_events(HTMLDocumentNode *doc) ...@@ -1312,8 +1312,10 @@ void detach_events(HTMLDocumentNode *doc)
int i; int i;
for(i=0; i < EVENTID_LAST; i++) { for(i=0; i < EVENTID_LAST; i++) {
if(doc->event_vector[i]) if(doc->event_vector[i]) {
detach_nsevent(doc, event_info[i].name); detach_nsevent(doc, event_info[i].name);
doc->event_vector[i] = FALSE;
}
} }
} }
......
...@@ -106,23 +106,23 @@ static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIAN ...@@ -106,23 +106,23 @@ static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIAN
return get_event_handler(&window->inner_window->doc->body_event_target, eid, var); return get_event_handler(&window->inner_window->doc->body_event_target, eid, var);
} }
static void detach_inner_window(HTMLOuterWindow *outer_window) static void detach_inner_window(HTMLInnerWindow *window)
{ {
HTMLInnerWindow *window = outer_window->base.inner_window; HTMLOuterWindow *outer_window = window->base.outer_window;
if(!window)
return;
if(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;
detach_events(window->doc); if(window->doc)
detach_events(window->doc);
abort_window_bindings(window); abort_window_bindings(window);
release_script_hosts(window); release_script_hosts(window);
window->doc->basedoc.window = NULL;
window->base.outer_window = NULL; window->base.outer_window = NULL;
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); if(outer_window && outer_window->base.inner_window == window) {
outer_window->base.inner_window = NULL;
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
}
} }
static inline HTMLWindow *impl_from_IHTMLWindow2(IHTMLWindow2 *iface) static inline HTMLWindow *impl_from_IHTMLWindow2(IHTMLWindow2 *iface)
...@@ -206,7 +206,8 @@ static void release_outer_window(HTMLOuterWindow *This) ...@@ -206,7 +206,8 @@ static void release_outer_window(HTMLOuterWindow *This)
remove_target_tasks(This->task_magic); remove_target_tasks(This->task_magic);
set_current_mon(This, NULL); set_current_mon(This, NULL);
detach_inner_window(This); if(This->base.inner_window)
detach_inner_window(This->base.inner_window);
release_children(This); release_children(This);
if(This->secmgr) if(This->secmgr)
...@@ -231,9 +232,8 @@ static void release_inner_window(HTMLInnerWindow *This) ...@@ -231,9 +232,8 @@ static void release_inner_window(HTMLInnerWindow *This)
TRACE("%p\n", This); TRACE("%p\n", This);
detach_inner_window(This);
remove_target_tasks(This->task_magic); remove_target_tasks(This->task_magic);
abort_window_bindings(This);
release_script_hosts(This);
if(This->doc) { if(This->doc) {
This->doc->window = NULL; This->doc->window = NULL;
...@@ -2877,7 +2877,8 @@ HRESULT update_window_doc(HTMLInnerWindow *window) ...@@ -2877,7 +2877,8 @@ HRESULT update_window_doc(HTMLInnerWindow *window)
return S_OK; return S_OK;
} }
detach_inner_window(outer_window); if(outer_window->base.inner_window)
detach_inner_window(outer_window->base.inner_window);
outer_window->base.inner_window = window; outer_window->base.inner_window = window;
outer_window->pending_window = NULL; outer_window->pending_window = 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