]> git.saurik.com Git - wxWidgets.git/commitdiff
Always check that we get a valid IDispatch* from get_Document as sometimes the call...
authorSteve Lamerton <steve.lamerton@gmail.com>
Thu, 12 Apr 2012 21:15:16 +0000 (21:15 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Thu, 12 Apr 2012 21:15:16 +0000 (21:15 +0000)
Fixes #14182

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/webview_ie.cpp

index 2bdae652c0354f58d0b9fb7913b2cd808f8923cc..c42c1a00eacdf34a0604d8b13fa0a95419000b23 100644 (file)
@@ -874,12 +874,13 @@ void wxWebViewIE::ExecCommand(wxString command)
 
 IHTMLDocument2* wxWebViewIE::GetDocument() const
 {
-    IDispatch* dispatch;
+    IDispatch* dispatch = NULL;
     HRESULT result = m_webBrowser->get_Document(&dispatch);
-    if(SUCCEEDED(result))
+    if(dispatch && SUCCEEDED(result))
     {
         IHTMLDocument2* document;
         dispatch->QueryInterface(IID_IHTMLDocument2, (void**)&document);
+        dispatch->Release();
         //document is set to null automatically if the interface isn't supported
         return document;
     }