Menu

#1 Remove unnecessary null pointer checks

open
nobody
None
5
2008-10-27
2008-10-27
No

Null pointer checks for member variables like "pcategory_prefixes" and "inputBuffer" are not needed for the delete instruction.
http://dietmar-kuehl.de/mirror/c++-faq/freestore-mgmt.html#faq-16.8
http://scribeserver.svn.sourceforge.net/viewvc/scribeserver/trunk/src/scribe_server.cpp?revision=3&view=markup
http://scribeserver.svn.sourceforge.net/viewvc/scribeserver/trunk/src/file.cpp?revision=3&view=markup

Can smart pointers like std::auto_ptr or boost::shared_ptr help in this use case?

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.