kdevelop patch.

W. Tasin tasin at fhm.edu
Thu Mar 28 17:34:03 UTC 2002


Hi,

Harald Fernengel wrote:

>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 ;)
>
that's ok... ;-)
but take care I have already seen code that tried to workaround some 
early GUI bugs that way.
So I hope you will stay to this statement in the next beta-stages ;-)

>
>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.
>

Thats also acceptable as long you set always the pointer to 0l 
immediately after the delete-keyword.

>
>
>After the call to the destructor the object is unusable by design, setting 
>pointers to 0 will just encourage people to write bad code...
>
On "internal" destructor calls I agree... but that was not the point ;-)
And please don't let us start with a discussion about bad and good code 
and encouraging people to do only good code ;-)

Believe me we already had this situation ...
and nobody recognized it... and after 2 days of searching the problem it 
was found.

In the end unfortunately it isn't only a question of bad code, but also 
of maintaining code which is patched by different users.

>
>Best regards,
>Harry
>
>_______________________________________________
>Kdevelop-devel mailing list
>Kdevelop-devel at barney.cs.uni-potsdam.de
>http://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>
Ciao

Walter





More information about the KDevelop-devel mailing list