shdocvw: Always set hostui to NULL in SetClientsite.

This commit is contained in:
Jacek Caban 2007-03-09 16:54:26 +01:00 committed by Alexandre Julliard
parent 355b3c190b
commit 0b48542f1f
1 changed files with 8 additions and 7 deletions

View File

@ -289,25 +289,26 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
This->inplace = NULL;
}
if(This->doc_host.hostui)
if(This->doc_host.hostui) {
IDocHostUIHandler_Release(This->doc_host.hostui);
This->doc_host.hostui = NULL;
}
if(This->client)
IOleClientSite_Release(This->client);
This->client = pClientSite;
if(!pClientSite) {
if(This->doc_host.document)
deactivate_document(&This->doc_host);
This->client = NULL;
return S_OK;
}
This->client = pClientSite;
IOleClientSite_AddRef(pClientSite);
hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler,
IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler,
(void**)&This->doc_host.hostui);
if(FAILED(hres))
This->doc_host.hostui = NULL;
hres = IOleClientSite_GetContainer(This->client, &container);
if(SUCCEEDED(hres)) {