diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-29 19:11:14 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-29 19:11:14 +0000 |
commit | 71db63c7cb006d266b305083330a31a426ec67bd (patch) | |
tree | 06a3b0f3fbac127e70537beb10ad482ff3f47705 /etc | |
parent | 98e10ed3f130684b8941c5dd3f9218a7de213a9a (diff) | |
download | ATCD-71db63c7cb006d266b305083330a31a426ec67bd.tar.gz |
added rule to not for a pointer being 0 before deleting it.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/ACE-guidelines.html | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/ACE-guidelines.html b/etc/ACE-guidelines.html index adad2e66a31..63470821de8 100644 --- a/etc/ACE-guidelines.html +++ b/etc/ACE-guidelines.html @@ -223,6 +223,11 @@ bgcolor="#ffffff"> <strong><code>delete []</code></strong> to correspond to the allocation.<p> + <li>Don't check for a pointer being 0 before deleting it. It's + always safe to delete a 0 pointer. If the pointer is visible + outside the local scope, it's often a good idea to 0 it + _after_ deleting it.<p> + <li>Always use <strong><code>ACE_NEW</code></strong> or <strong><code>ACE_NEW_RETURN</code></strong> to allocate memory, because they check for successful allocation and set errno |