hhctl.ocx: Fix reference count leak in InPlace_OnPosRectChange.

Also compare the result of IOleObject_QueryInterface with S_OK instead
of using not operator so it is more clear what the code is doing.
This commit is contained in:
Rob Shearman 2008-08-17 18:28:24 +01:00 committed by Alexandre Julliard
parent 24c5df3dc1
commit 602b58ba73
1 changed files with 5 additions and 1 deletions

View File

@ -365,8 +365,12 @@ static HRESULT STDMETHODCALLTYPE InPlace_OnPosRectChange(IOleInPlaceSite *iface,
ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface); ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
IOleInPlaceObject *inplace; IOleInPlaceObject *inplace;
if (!IOleObject_QueryInterface(This->pBrowserObject, &IID_IOleInPlaceObject, (void **)&inplace)) if (IOleObject_QueryInterface(This->pBrowserObject, &IID_IOleInPlaceObject,
(void **)&inplace) == S_OK)
{
IOleInPlaceObject_SetObjectRects(inplace, lprcPosRect, lprcPosRect); IOleInPlaceObject_SetObjectRects(inplace, lprcPosRect, lprcPosRect);
IOleInPlaceObject_Release(inplace);
}
return S_OK; return S_OK;
} }