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

ieframe: Keep reference to This in all IDocObjectService callback calls.

parent dc06802a
...@@ -708,10 +708,15 @@ static HRESULT WINAPI DocObjectService_FireBeforeNavigate2( ...@@ -708,10 +708,15 @@ static HRESULT WINAPI DocObjectService_FireBeforeNavigate2(
V_VT(params+6) = (VT_DISPATCH); V_VT(params+6) = (VT_DISPATCH);
V_DISPATCH(params+6) = (IDispatch*)This->doc_host->wb; V_DISPATCH(params+6) = (IDispatch*)This->doc_host->wb;
/* Keep reference to This. It may be released in event handler. */
IShellBrowser_AddRef(&This->IShellBrowser_iface);
TRACE(">>>\n"); TRACE(">>>\n");
call_sink(This->doc_host->cps.wbe2, DISPID_BEFORENAVIGATE2, &dp); call_sink(This->doc_host->cps.wbe2, DISPID_BEFORENAVIGATE2, &dp);
TRACE("<<<\n"); TRACE("<<<\n");
IShellBrowser_Release(&This->IShellBrowser_iface);
SysFreeString(V_BSTR(&var_url)); SysFreeString(V_BSTR(&var_url));
SysFreeString(V_BSTR(&var_headers)); SysFreeString(V_BSTR(&var_headers));
SysFreeString(V_BSTR(&var_frame_name)); SysFreeString(V_BSTR(&var_frame_name));
...@@ -764,6 +769,9 @@ static HRESULT WINAPI DocObjectService_FireNavigateComplete2( ...@@ -764,6 +769,9 @@ static HRESULT WINAPI DocObjectService_FireNavigateComplete2(
V_VT(&url_var) = VT_BSTR; V_VT(&url_var) = VT_BSTR;
V_BSTR(&url_var) = url; V_BSTR(&url_var) = url;
/* Keep reference to This. It may be released in event handler. */
IShellBrowser_AddRef(&This->IShellBrowser_iface);
TRACE(">>>\n"); TRACE(">>>\n");
call_sink(This->doc_host->cps.wbe2, DISPID_NAVIGATECOMPLETE2, &dp); call_sink(This->doc_host->cps.wbe2, DISPID_NAVIGATECOMPLETE2, &dp);
TRACE("<<<\n"); TRACE("<<<\n");
...@@ -771,6 +779,7 @@ static HRESULT WINAPI DocObjectService_FireNavigateComplete2( ...@@ -771,6 +779,7 @@ static HRESULT WINAPI DocObjectService_FireNavigateComplete2(
SysFreeString(url); SysFreeString(url);
This->doc_host->busy = VARIANT_FALSE; This->doc_host->busy = VARIANT_FALSE;
IShellBrowser_Release(&This->IShellBrowser_iface);
return S_OK; return S_OK;
} }
......
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