270 | | * Don't do "`if (p) delete p;`". (That's redundant since "`delete NULL;`" is safe and does nothing.) |
271 | | |
272 | | * If deleting a pointer, and it's not in a destructor, and it's not being immediately assigned a new value, use "`SAFE_DELETE(p)`" (which is equivalent to "`delete p; p = NULL;`") to avoid dangling pointers to deleted memory. |
| 270 | * Don't do "`if (p) delete p;`". (That's redundant since "`delete nullptr;`" is safe and does nothing.) |
| 271 | |
| 272 | * If deleting a pointer, and it's not in a destructor, and it's not being immediately assigned a new value, use "`SAFE_DELETE(p)`" (which is equivalent to "`delete p; p = nullptr;`") to avoid dangling pointers to deleted memory. |