Rob Shearman : hhctl.ocx: Fix reference count leak in InPlace_OnPosRectChange.

Alexandre Julliard julliard at winehq.org
Mon Aug 18 10:47:18 CDT 2008


Module: wine
Branch: master
Commit: 602b58ba73f9042f88d5cc7074bfe33217576a54
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=602b58ba73f9042f88d5cc7074bfe33217576a54

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Sun Aug 17 18:28:24 2008 +0100

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.

---

 dlls/hhctrl.ocx/webbrowser.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/hhctrl.ocx/webbrowser.c b/dlls/hhctrl.ocx/webbrowser.c
index c9caa38..5033197 100644
--- a/dlls/hhctrl.ocx/webbrowser.c
+++ b/dlls/hhctrl.ocx/webbrowser.c
@@ -365,8 +365,12 @@ static HRESULT STDMETHODCALLTYPE InPlace_OnPosRectChange(IOleInPlaceSite *iface,
     ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
     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_Release(inplace);
+    }
 
     return S_OK;
 }




More information about the wine-cvs mailing list