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
This commit is contained in:
@@ -183,6 +183,8 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
|
|||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
// ShowException(szMember, hr, NULL, 0);
|
// 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
|
// Again, reverse args
|
||||||
if (!ConvertVariantToOle(INVOKEARG((noArgs-1) - i), oleArgs[i]))
|
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;
|
||||||
|
Reference in New Issue
Block a user