Fixes #14182
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71192
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
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;
}