mshtml: Don't hold ref to the created window in the FrameBase.

Note that for the case when mozwindow_to_window returns an existing window,
no ref is added to it anyway, so this is just leaking.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
Gabriel Ivăncescu 2023-01-03 18:27:04 +02:00 committed by Alexandre Julliard
parent 6a1b12bd8f
commit 355eb6b91b

View file

@ -48,9 +48,14 @@ static HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc)
return E_FAIL;
window = mozwindow_to_window(mozwindow);
if(!window && frame->element.node.doc->browser)
if(!window && frame->element.node.doc->browser) {
hres = create_outer_window(frame->element.node.doc->browser, mozwindow,
frame->element.node.doc->outer_window, &window);
/* Don't hold ref to the created window; the parent keeps ref to it */
if(SUCCEEDED(hres))
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
}
mozIDOMWindowProxy_Release(mozwindow);
if(FAILED(hres))
return hres;