Re: death in dealloc

2010-03-14 Thread Matt Neuburg
On Sat, 13 Mar 2010 16:46:28 -0500, Steven Degutis
 said:
>This is almost always caused by releasing an object earlier than you
>expected to, and then trying to release it again later (similar to "double
>free"). Look around in your class's code

Wouldn't this be clearly called out by use of NSZombies? Use of the "look
around in your code" technique would then be unnecessary. m.

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[SOLVED] Re: death in dealloc

2010-03-14 Thread Stuart Malin
Spot on, Steven. My memory management was faulty. My object had been 
instantiating another object via alloc that it kept a reference to in an iVar, 
and my (outer) object released that instantiated (inner) object in its -dealloc 
method. I refactored the code, and changed the way I acquire the (inner) object 
to use a class factory method, which returned an autoreleased instance. Of 
course, with this change, the reference to the (inner) object should no longer 
be held by an iVar, and so I have now changed that as well.

On Mar 13, 2010, at 4:46 PM, Steven Degutis wrote:

> This is almost always caused by releasing an object earlier than you expected 
> to, and then trying to release it again later (similar to "double free"). 
> Look around in your class's code for a place where you autorelease an ivar, 
> but don't add it to a collection, or where you release an ivar but don't set 
> it to nil afterwards.
> 
> -Steven
> 
> On Sat, Mar 13, 2010 at 12:53 PM, Stuart Malin  wrote:
> I have some code that is throwing EXC_BAD_ACCESS. It does so when an object 
> is deallocating, in its -dealloc method on a call to [super dealloc]. The 
> object's class's superclass is NSObject. Here's the (relevant part of the) 
> stack trace:
> 
> #0  0x7fff872e016d in _class_hasCxxStructorsNoSuper
> #1  0x7fff872e0741 in object_cxxDestructFromClass
> #2  0x7fff872e60f8 in objc_destructInstance
> #3  0x7fff872e06f5 in _internal_object_dispose
> #4  0x7fff83e0279a in -[NSObject(NSObject) dealloc]
> #5  0x10007b18e in -[ZPOauthParams dealloc] at ZPOauthParams.m:57
> 
> I know I must have blown something, but I have no idea what I could have done 
> to cause this sort of problem. If anyone has seen something like this before, 
> please let me in what direction I should look for the problem. TIA.
> 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: death in dealloc

2010-03-13 Thread Steven Degutis
This is almost always caused by releasing an object earlier than you
expected to, and then trying to release it again later (similar to "double
free"). Look around in your class's code for a place where you autorelease
an ivar, but don't add it to a collection, or where you release an ivar but
don't set it to nil afterwards.

-Steven

On Sat, Mar 13, 2010 at 12:53 PM, Stuart Malin  wrote:

> I have some code that is throwing EXC_BAD_ACCESS. It does so when an object
> is deallocating, in its -dealloc method on a call to [super dealloc]. The
> object's class's superclass is NSObject. Here's the (relevant part of the)
> stack trace:
>
> #0  0x7fff872e016d in _class_hasCxxStructorsNoSuper
> #1  0x7fff872e0741 in object_cxxDestructFromClass
> #2  0x7fff872e60f8 in objc_destructInstance
> #3  0x7fff872e06f5 in _internal_object_dispose
> #4  0x7fff83e0279a in -[NSObject(NSObject) dealloc]
> #5  0x10007b18e in -[ZPOauthParams dealloc] at ZPOauthParams.m:57
>
> I know I must have blown something, but I have no idea what I could have
> done to cause this sort of problem. If anyone has seen something like this
> before, please let me in what direction I should look for the problem. TIA.
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/steven.degutis%40gmail.com
>
> This email sent to steven.degu...@gmail.com
>



-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


death in dealloc

2010-03-13 Thread Stuart Malin
I have some code that is throwing EXC_BAD_ACCESS. It does so when an object is 
deallocating, in its -dealloc method on a call to [super dealloc]. The object's 
class's superclass is NSObject. Here's the (relevant part of the) stack trace:

#0  0x7fff872e016d in _class_hasCxxStructorsNoSuper
#1  0x7fff872e0741 in object_cxxDestructFromClass
#2  0x7fff872e60f8 in objc_destructInstance
#3  0x7fff872e06f5 in _internal_object_dispose
#4  0x7fff83e0279a in -[NSObject(NSObject) dealloc]
#5  0x10007b18e in -[ZPOauthParams dealloc] at ZPOauthParams.m:57

I know I must have blown something, but I have no idea what I could have done 
to cause this sort of problem. If anyone has seen something like this before, 
please let me in what direction I should look for the problem. TIA.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com