kdevelop patch.

Harald Fernengel harry at kdevelop.org
Thu Mar 28 16:33:06 UTC 2002


Hi,

> ... to prevent double or triple deletion !ALWAYS! set those pointers to
> NULL after object deletion.

I agree for every other function but not for destructors.

If I catch anyone calling a destructor manually I'll personally see that his 
CVS account gets deleted once and for every time ;)

If you have to do cleanup then add a "void cleanup()" (and call cleanup() also 
from your destructor). In this private function you set all your pointers to 
0 after deletion.

After the call to the destructor the object is unusable by design, setting 
pointers to 0 will just encourage people to write bad code...

Best regards,
Harry




More information about the KDevelop-devel mailing list