X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17271c793e0d938dc4a189b540b6438ce1839230..5541d1fda4b73af86e42b2f43724f0c063a352d0:/src/common/cmdproc.cpp diff --git a/src/common/cmdproc.cpp b/src/common/cmdproc.cpp index f6d7eb8dd5..7466686e7a 100644 --- a/src/common/cmdproc.cpp +++ b/src/common/cmdproc.cpp @@ -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);