Possible duplicate:
Is it worth pointing to pointers to NULL in the destructor?
I see code like this,
void ClassA::~ClassA()
{
delete member;
member = NULL;
}
since a particular instance no longer exists after this destructor (or the instance is destroyed and its members can no longer be used or dereferenced), what is the use of assigning NULL to the pointer of a member variable?
Is it just a practice of deleting a pointer elsewhere and assigning it NULL?
source
share