From: Gabriel Ivăncescu gabrielopcode@gmail.com
It does *not* add a ref to the returned frame.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlwindow.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 732f5ec7316..f013ba20d1c 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3593,8 +3593,6 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, if(SUCCEEDED(hres) && frame) { global_prop_t *prop;
- IHTMLWindow2_Release(&frame->base.IHTMLWindow2_iface); - prop = alloc_global_prop(window, GLOBAL_FRAMEVAR, bstrName); if(!prop) return E_OUTOFMEMORY;
From: Gabriel Ivăncescu gabrielopcode@gmail.com
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 --- dlls/mshtml/htmlframe.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index e1b1562b0dc..38bb53dc551 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -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;
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlimg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index c0333cab858..01cc8405f87 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -855,8 +855,10 @@ static ULONG WINAPI HTMLImageElementFactory_Release(IHTMLImageElementFactory *if
TRACE("(%p) ref=%ld\n", This, ref);
- if(!ref) + if(!ref) { + release_dispex(&This->dispex); free(This); + }
return ref; }
From: Gabriel Ivăncescu gabrielopcode@gmail.com
It's not an element, so it doesn't even implement those interfaces.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlselect.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index 4dfbbd916a7..c5610b41a1d 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -646,7 +646,6 @@ static dispex_static_data_t HTMLOptionElementFactory_dispex = { &HTMLOptionElementFactory_dispex_vtbl, IHTMLOptionElementFactory_tid, HTMLOptionElementFactory_iface_tids, - HTMLElement_init_dispex_info };
HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, HTMLOptionElementFactory **ret_ptr)
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/tests/events.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index cd6006805d4..30b6d8799b6 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -1270,6 +1270,7 @@ static HRESULT WINAPI submit_onclick_attached_check_cancel(IDispatchEx *iface, D ok(event != NULL, "event == NULL\n");
test_event_cancelbubble(event, VARIANT_TRUE); + IHTMLEventObj_Release(event); return S_OK; }
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/tests/dom.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 6a960bfa21f..c9c52776fa9 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -1350,6 +1350,7 @@ static IHTMLDocument2 *_get_doc_node(unsigned line, IHTMLDocument2 *doc) hres = IHTMLWindow2_get_document(window, &ret); ok_(__FILE__,line)(hres == S_OK, "get_document failed: %08lx\n", hres); ok_(__FILE__,line)(ret != NULL, "document = NULL\n"); + IHTMLWindow2_Release(window);
return ret; } @@ -6313,6 +6314,7 @@ static void test_location(IHTMLDocument2 *doc) ok(hres == S_OK, "get_location failed: %08lx\n", hres); ok(location == location2, "location != location2\n"); IHTMLLocation_Release(location2); + IHTMLWindow2_Release(window);
test_ifaces((IUnknown*)location, location_iids); test_disp2((IUnknown*)location, &DIID_DispHTMLLocation, &IID_IHTMLLocation, NULL, L"about:blank"); @@ -7564,6 +7566,7 @@ static void test_xhr(IHTMLDocument2 *doc) SysFreeString(str);
IHTMLWindow2_Release(window); + IDispatchEx_Release(dispex); }
static void test_defaults(IHTMLDocument2 *doc)
This merge request was approved by Jacek Caban.