From: Julian Smart Date: Fri, 3 Jan 2003 14:59:07 +0000 (+0000) Subject: Clean up memory if have to exit early X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/12335fa6aa8db0d0044ff4dbfa9ea056b57b0a66 Clean up memory if have to exit early git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 3870d96263..de72abc752 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;