From 344743eaa5f59ecd60f6fc94ee81be53a6d9202d Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 3 Jan 2003 14:59:07 +0000 Subject: [PATCH] Clean up memory if have to exit early git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/ole/automtn.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 3870d96263..157a4200bb 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -183,6 +183,8 @@ bool wxAutomationObject::Invoke(const wxString& member, int action, if (FAILED(hr)) { // ShowException(szMember, hr, NULL, 0); + delete[] argNames; + delete[] dispIds; return FALSE; } @@ -201,7 +203,12 @@ bool wxAutomationObject::Invoke(const wxString& member, int action, { // Again, reverse args if (!ConvertVariantToOle(INVOKEARG((noArgs-1) - i), oleArgs[i])) - return FALSE; // TODO: clean up memory at this point + { + delete[] argNames; + delete[] dispIds; + delete[] oleArgs; + return FALSE; + } } dispparams.rgdispidNamedArgs = dispIds + 1;