[Uml-devel] dynamic_cast usage

Luis De la Parra Blum lparrab at gmx.net
Wed Dec 18 17:21:08 UTC 2002


On Wednesday 18 December 2002 22:53, Jonathan Riddell wrote:
>
> > Another thing I just noticed: deleting a 0L-pointer is perfectly valid,
> > i.e. there is no need check for non-0L before deleting something, like if
> > ( foo )
> > 	delete foo;
>
> Of course you have to make sure that foo really is null first and not
> completely uninitialised!

nop.  
Carsten is right there. If you delete a pointer whose value is 0L, nothing 
happens (this is assured by the language)

the only problem is if you delete some object and NOT set the pointer to null 
or if you have two pointer to the objects, but in those cases doing a if(foo) 
won't help either.

luis




More information about the umbrello-devel mailing list