Re: test if a pointer is pointing to a valid object or not?
Re: test if a pointer is pointing to a valid object or not?
- Subject: Re: test if a pointer is pointing to a valid object or not?
- From: "Alastair J.Houghton" <email@hidden>
- Date: Wed, 29 Oct 2003 17:55:43 +0000
On Wednesday, October 29, 2003, at 05:50 pm, Ben Dougall wrote:
On Wednesday, October 29, 2003, at 02:57 pm, Alastair J.Houghton
wrote:
On Wednesday, October 29, 2003, at 02:37 pm, p3consulting wrote:
And of course if you really try to fake it with an address on
something you will build by hand you may be successfull
but at least we have something the original poster may use and its
program will stop crashing and he can log to try to find out where
its object pointer was "corrupted"
From what Ben wrote, I didn't get the impression that he was trying
to
debug his application. I think he was trying to find a way to avoid
having to know whether he'd released an object or not.
no, that's right - nothing to do with debugging. but not particularly
about knowing if an object was released or not either, although that
certainly could be part of finding out if a non-null value is a valid
object or not i suppose.
basically i have a non-null value that could potentially be a valid
pointer or could not be a valid pointer, and was wondering if it was
possible to test it safely in a running app. that situation, of having
a non-null value that could or could not be a valid pointer, could be
avoided in the first place - it's not a major problem as such, but
it'd be cool to be able to test the pointer rather than avoid the
situation.
*Much* better just to avoid the situation. Pascal's code (and
comments) aren't 100% reliable if you're debugging, and certainly
aren't the sort of thing you'd want in a shipping application. (No
offence intended, Pascal).
Kind regards,
Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.