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;