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:
parent
ef2060faf3
commit
ca1b5af1c4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user