Commit 0be2db2e authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Hold a ref to the location on the window side.

parent 3a196ef6
...@@ -68,9 +68,7 @@ static inline BOOL is_outer_window(HTMLWindow *window) ...@@ -68,9 +68,7 @@ static inline BOOL is_outer_window(HTMLWindow *window)
static HRESULT get_location(HTMLInnerWindow *This, HTMLLocation **ret) static HRESULT get_location(HTMLInnerWindow *This, HTMLLocation **ret)
{ {
if(This->location) { if(!This->location) {
IHTMLLocation_AddRef(&This->location->IHTMLLocation_iface);
}else {
HRESULT hres; HRESULT hres;
hres = HTMLLocation_Create(This, &This->location); hres = HTMLLocation_Create(This, &This->location);
...@@ -78,6 +76,7 @@ static HRESULT get_location(HTMLInnerWindow *This, HTMLLocation **ret) ...@@ -78,6 +76,7 @@ static HRESULT get_location(HTMLInnerWindow *This, HTMLLocation **ret)
return hres; return hres;
} }
IHTMLLocation_AddRef(&This->location->IHTMLLocation_iface);
*ret = This->location; *ret = This->location;
return S_OK; return S_OK;
} }
......
...@@ -6015,7 +6015,6 @@ static void test_location(IHTMLDocument2 *doc) ...@@ -6015,7 +6015,6 @@ static void test_location(IHTMLDocument2 *doc)
IHTMLLocation *location, *location2; IHTMLLocation *location, *location2;
IHTMLWindow2 *window; IHTMLWindow2 *window;
BSTR str; BSTR str;
ULONG ref;
HRESULT hres; HRESULT hres;
hres = IHTMLDocument2_get_location(doc, &location); hres = IHTMLDocument2_get_location(doc, &location);
...@@ -6051,8 +6050,7 @@ static void test_location(IHTMLDocument2 *doc) ...@@ -6051,8 +6050,7 @@ static void test_location(IHTMLDocument2 *doc)
ok(!lstrcmpW(str, L"about:blank"), "unexpected href %s\n", wine_dbgstr_w(str)); ok(!lstrcmpW(str, L"about:blank"), "unexpected href %s\n", wine_dbgstr_w(str));
SysFreeString(str); SysFreeString(str);
ref = IHTMLLocation_Release(location); IHTMLLocation_Release(location);
ok(!ref, "location should be destroyed here\n");
} }
static void test_plugins_col(IHTMLDocument2 *doc) static void test_plugins_col(IHTMLDocument2 *doc)
......
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