Tue Mar 23 15:15:00 GMT 2004
So always do this when declaring a pointer:
Foo* pFoo = NULL; // or else "= new Foo"
And do this when deleting a pointed to object:
pFoo = NULL;
...unless you've determined (via profiling) the performance penalty is too
high for your application.
Or try to use std::auto_ptr to help with your pointer resource management.
Except when the performance penalty is too high for your application.
Or considering using one of the more memory management friendly languages,
such as Java. (That's "friendly" in the sense of "safe and easy; one less
thing to worry about".)
More information about the Gcc-help