From 362b1220b426e38d2a82ffb3937bd664e3350358 Mon Sep 17 00:00:00 2001 From: PB Date: Sun, 16 Jul 2017 23:04:22 +0200 Subject: [PATCH] Fix a few more BSTR leaks in wxWebViewIE Use wxBasicString to ensure that temporary BSTRs are correctly freed. --- src/msw/webview_ie.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index 848068d59d..386e080765 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -692,9 +692,9 @@ void wxWebViewIE::SetEditable(bool enable) if(document) { if( enable ) - document->put_designMode(SysAllocString(L"On")); + document->put_designMode(wxBasicString("On")); else - document->put_designMode(SysAllocString(L"Off")); + document->put_designMode(wxBasicString("Off")); } } @@ -867,8 +867,8 @@ void wxWebViewIE::RunScript(const wxString& javascript) VARIANT level; VariantInit(&level); V_VT(&level) = VT_EMPTY; - window->execScript(SysAllocString(javascript.wc_str()), - SysAllocString(language.wc_str()), + window->execScript(wxBasicString(javascript), + wxBasicString(language), &level); } } @@ -913,7 +913,7 @@ bool wxWebViewIE::CanExecCommand(wxString command) const { VARIANT_BOOL enabled; - document->queryCommandEnabled(SysAllocString(command.wc_str()), &enabled); + document->queryCommandEnabled(wxBasicString(command), &enabled); return (enabled == VARIANT_TRUE); } @@ -930,7 +930,7 @@ void wxWebViewIE::ExecCommand(wxString command) if(document) { - document->execCommand(SysAllocString(command.wc_str()), VARIANT_FALSE, VARIANT(), NULL); + document->execCommand(wxBasicString(command), VARIANT_FALSE, VARIANT(), NULL); } }