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."
Paul Tagliamonte paultag@fluxbox.org
1 files changed,
1 insertions(+),
2 deletions(-)
jump to
M
src/FbTk/MultiButtonMenuItem.cc
→
src/FbTk/MultiButtonMenuItem.cc
@@ -41,8 +41,7 @@ init(buttons);
} 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) {