]> git.saurik.com Git - wxWidgets.git/commitdiff
Clean up memory if have to exit early
authorJulian Smart <julian@anthemion.co.uk>
Fri, 3 Jan 2003 14:59:07 +0000 (14:59 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 3 Jan 2003 14:59:07 +0000 (14:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/ole/automtn.cpp

index 3870d9626358a310e2be0f8a7a56af27fee0bf24..de72abc752fea80c0c8aa1ee55aec2436a9f5d59 100644 (file)
@@ -183,6 +183,8 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
        if (FAILED(hr)) 
        {
 //             ShowException(szMember, hr, NULL, 0);
        if (FAILED(hr)) 
        {
 //             ShowException(szMember, hr, NULL, 0);
+           delete[] argNames;
+           delete[] dispIds;
                return FALSE;
        }
 
                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]))
        {
                // 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;
        }
 
        dispparams.rgdispidNamedArgs = dispIds + 1;