In C++, it is unnecessary to check for non-NULL before invoking delete:
if (foo) delete foo;
can be more simply written as
(Ref: section 5.3.5 of the C++98 spec, paragraph 2.)
This patch just fixes some initial cases I came across; no doubt there are others waiting to be found.