Mail from god

Posted on Friday, November 21, 2008 by Anuj Mehta

Just came across an old mail from God aka Bjarne Stroustrup. I was ecstatic when I received a mail from him as I never expected a reply for such a naive query. Below is the mail



From: Bjarne Stroustrup [mailto:bs@cs.tamu.edu]
Sent: Saturday, August 18, 2007 7:12 AM
To: Anuj Mehta
Subject: Re: Deletion of a Pointer Twice

Bjarne Stroustrup wrote:
> From: "Anuj Mehta"
> To:
> Subject: Deletion of a Pointer Twice
> Date: Thu, 21 Jun 2007 09:17:06 +0530
>
>
> Hi
>
>
>
> In my project I am getting a runtime error which is due to deletion of a
> pointer twice.
>
> Code size of the project is really huge.
>
> Also the stack trace does not point towards a particular pointer so that I
> can make it NULL after deletion.
>
>
>
> I tried to put a try/catch but the control does not come to catch block. I
> had tried catch (std::exception & excep)
>
> Can u please suggest me a way through which I can solve this problem?
>

Don't delete a pointer twice.

I don't see any alternative to tracking down that bug. It is serious and
could easily be the indicator of some serious problems with resource
management. Try using a leak detector; sometimes they can catch double
deletions.



>
>
> Regards,
>
> Anuj Mehta
>
> "Nothing endures but change"

0 Responses to "Mail from god":