delete the command if we failed to execute it (bug 515687)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2002-02-13 23:34:25 +00:00
parent ef2060faf3
commit ca1b5af1c4

View File

@ -93,7 +93,12 @@ bool wxCommandProcessor::Submit(wxCommand *command, bool storeIt)
wxCHECK_MSG( command, FALSE, _T("no command in wxCommandProcessor::Submit") );
if ( !DoCommand(*command) )
{
// the user code expects the command to be deleted anyhow
delete command;
return FALSE;
}
if ( storeIt )
Store(command);