Re: Error on deleting pointer
Re: Error on deleting pointer
- Subject: Re: Error on deleting pointer
- From: Sean McBride <email@hidden>
- Date: Mon, 12 Sep 2011 16:51:30 -0400
- Organization: Rogue Research Inc.
On Mon, 12 Sep 2011 13:02:54 -0500, Ray, Jeffrey R. {Jeff}(DFRC-ME) said:
>This won't help you with finding where the problem is, but you might
>consider adopting the coding style of setting invalid pointers to zero:
>
>if(pointer){
> delete pointer;
> pointer = 0;
>}
The 'if' is not needed as the standard guarantees that 'delete NULL' does nothing. Setting the pointer to 0 afterwards can indeed be a good idea.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden