mshtml: Better handling of IDocHostUIHandler in SetClientSite.

This commit is contained in:
Jacek Caban 2006-01-14 17:04:54 +01:00 committed by Alexandre Julliard
parent 068cedc7f2
commit d44364d3fe
1 changed files with 10 additions and 7 deletions

View File

@ -73,17 +73,19 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
if(pClientSite == This->client)
return S_OK;
if(This->client)
if(This->client) {
IOleClientSite_Release(This->client);
if(This->hostui)
IDocHostUIHandler_Release(This->hostui);
if(!pClientSite) {
This->client = NULL;
return S_OK;
}
if(This->hostui) {
IDocHostUIHandler_Release(This->hostui);
This->hostui = NULL;
}
if(!pClientSite)
return S_OK;
hres = IOleObject_QueryInterface(pClientSite, &IID_IDocHostUIHandler, (void**)&pDocHostUIHandler);
if(SUCCEEDED(hres)) {
DOCHOSTUIINFO hostinfo;
@ -120,6 +122,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
}
CoTaskMemFree(override_key_path);
}
IDocHostUIHandler2_Release(pDocHostUIHandler2);
}
This->has_key_path = TRUE;