Browse Source

QueryInterface should be matched with Release

Though in these two cases, the objects do not seem to be reference-counted anyway

Source commit: 34237b24b62bde64ff1fdbc5ee870166171134b2
Martin Prikryl 2 years ago
parent
commit
1244c3e4ff
1 changed files with 2 additions and 0 deletions
  1. 2 0
      source/windows/GUITools.cpp

+ 2 - 0
source/windows/GUITools.cpp

@@ -1164,6 +1164,7 @@ public:
     // Something keeps the reference behind otherwise and calls it on WM_SETTINGCHANGE.
     // Would make sense with TWebBrowserEx, which leaks. But it happens even with TWebBrowser.
     FCustomDoc->SetUIHandler(NULL);
+    FCustomDoc->Release();
   }
 
 protected:
@@ -1522,6 +1523,7 @@ void LoadBrowserDocument(TWebBrowserEx * WebBrowser, const UnicodeString & Docum
       DebugAlwaysTrue(PersistStreamInit != NULL))
   {
     PersistStreamInit->Load(static_cast<_di_IStream>(*DocumentStreamAdapter));
+    PersistStreamInit->Release();
   }
 }
 //---------------------------------------------------------------------------