Mail Archives: djgpp/1997/02/17/01:01:26
Erik Max Francis <max AT alcyone DOT com> wrote:
>The draft standard indicates that deleting a null pointer will have no
>effect. Even if the _Annotated C++ Reference Manual_ reads, "The effect of
>applying delete to a pointer not obtained from the new operator without a
>placement specification is undefined and usually harmful. Deleting a point
>with the value zero, however, is guaranteed to be harmless" (p. 63).
And wouldn't it be nice if delete not only deallocated the memory used,
but also set the pointer to NULL. This would eliminate the dangers of
deleting something more than once.
-- Dave Cigna
- Raw text -