From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlwindow.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 47e65472c01..4afa434ad27 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -112,9 +112,11 @@ static void detach_inner_window(HTMLInnerWindow *window)
while(!list_empty(&window->children)) { HTMLOuterWindow *child = LIST_ENTRY(list_tail(&window->children), HTMLOuterWindow, sibling_entry); + HTMLOuterWindow *parent = child->parent;
list_remove(&child->sibling_entry); child->parent = NULL; + IHTMLWindow2_Release(&parent->base.IHTMLWindow2_iface);
if(child->base.inner_window) detach_inner_window(child->base.inner_window); @@ -4330,6 +4332,8 @@ static nsresult NSAPI outer_window_traverse(void *ccp, void *p, nsCycleCollectio note_cc_edge((nsISupports*)&window->pending_window->base.IHTMLWindow2_iface, "pending_window", cb); if(window->base.inner_window) note_cc_edge((nsISupports*)&window->base.inner_window->base.IHTMLWindow2_iface, "inner_window", cb); + if(window->parent) + note_cc_edge((nsISupports*)&window->parent->base.IHTMLWindow2_iface, "parent", cb); if(window->location) note_cc_edge((nsISupports*)&window->location->IHTMLLocation_iface, "location", cb); if(window->nswindow) @@ -4359,6 +4363,11 @@ static nsresult NSAPI outer_window_unlink(void *p) set_current_uri(window, NULL); if(window->base.inner_window) detach_inner_window(window->base.inner_window); + if(window->parent) { + HTMLOuterWindow *parent = window->parent; + window->parent = NULL; + IHTMLWindow2_Release(&parent->base.IHTMLWindow2_iface); + } if(window->location) { HTMLLocation *location = window->location; window->location = NULL; @@ -4490,6 +4499,7 @@ HRESULT create_outer_window(GeckoBrowser *browser, mozIDOMWindowProxy *mozwindow
if(parent) { IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); + IHTMLWindow2_AddRef(&parent->base.IHTMLWindow2_iface);
window->parent = parent; list_add_tail(&parent->base.inner_window->children, &window->sibling_entry);