No need to check if a pointer is null before de-allocating it.

5.3.5/2 of the C++ standard:

  "In either alternative, if the value of the operand of delete is the null
   pointer the operation has no effect."
This commit is contained in:
Paul Tagliamonte 2011-11-11 14:29:57 +00:00 committed by Mathias Gumz
parent a2cf6fff7b
commit 0f994dbb28

View file

@ -41,8 +41,7 @@ MultiButtonMenuItem::MultiButtonMenuItem(int buttons, const FbTk::BiDiString &la
}
MultiButtonMenuItem::~MultiButtonMenuItem() {
if (m_button_exe != 0)
delete [] m_button_exe;
delete [] m_button_exe;
}
void MultiButtonMenuItem::setCommand(int button, FbTk::RefCount<FbTk::Command<void> > &cmd) {