Re: Release mode bindings crash and release pools
Re: Release mode bindings crash and release pools
- Subject: Re: Release mode bindings crash and release pools
- From: Quincey Morris <email@hidden>
- Date: Thu, 15 Jun 2017 12:03:29 -0700
On Jun 15, 2017, at 04:46 , Jonathan Mitchell <email@hidden> wrote:
>
> The crash occurs when the pool gets drained.
> Wrapping my -bind: calls in a release pool solves the issue too.
The information you’ve provided doesn’t make a lot of sense by itself. If
draining an autorelease pool is leading to a crash, then putting the affected
objects in a different autorelease pool and draining *that* should also crash.
My guess is that the problem has nothing to do with autorelease pools directly.
Instead, I think it’s symptomatic of a memory management problem around the
time a window is closed, which is a known area of difficulty. There are a
number of delegate properties that are unsafe/unowned, and that’s where I’d
look for the problem.
> a views window has been deallocated but the controller dealloc queries the
> responder chain - which uses assign semantics - and boom
But boom on what class of object? If you’ve modified the responder chain but
not removed your additions before they are deallocation, that’s your fault —
you have to think of a way to keep the objects alive longer.
Keep in mind that the window “delegate” property is unsafe/unowned, and it
normally points to the window controller. Since the delegate is de-facto though
not literally in the responder chain, an early death of the window controller
can be problematic.
Have you tried turning on Zombies to find out which incorrect reference is
being followed?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden