From 3a1ce6a864acfe3e0143b1c1bea663be15d6ddeb Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 15 May 2013 12:52:41 +0200 Subject: [PATCH] ieframe: Keep reference to ShellObject while calling DocumentComplete event. --- dlls/ieframe/shellbrowser.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/ieframe/shellbrowser.c b/dlls/ieframe/shellbrowser.c index 944c7bcd48e..55763db0050 100644 --- a/dlls/ieframe/shellbrowser.c +++ b/dlls/ieframe/shellbrowser.c @@ -824,12 +824,18 @@ static HRESULT WINAPI DocObjectService_FireDocumentComplete( V_VT(&url_var) = VT_BSTR; V_BSTR(&url_var) = url; + /* Keep reference to This. It may be released in event handler. */ + IShellBrowser_AddRef(&This->IShellBrowser_iface); + TRACE(">>>\n"); call_sink(This->doc_host->cps.wbe2, DISPID_DOCUMENTCOMPLETE, &dp); TRACE("<<<\n"); SysFreeString(url); - This->doc_host->busy = VARIANT_FALSE; + if(This->doc_host) + This->doc_host->busy = VARIANT_FALSE; + + IShellBrowser_Release(&This->IShellBrowser_iface); return S_OK; }