CALayers are rooted in GC only apps
CALayers are rooted in GC only apps
- Subject: CALayers are rooted in GC only apps
- From: Michael Link <email@hidden>
- Date: Sat, 09 Jul 2011 19:20:47 -0500
In an application that is built gc-only it seems that any CALayers added as sublayers to an NSView are rooted (perhaps by CFRetain) and if those layers have any references to the NSView that is hosting them then they can cause a memory leak.
I have a view that has sublayers that accept completion blocks for actions on mouse clicks. If the block references the view then when the window is closed (set to release when closed) the window, view ect are retained because the layer is rooted.
When running in instruments it is telling me that the layer has a "Non-zero CF retain count" and that's why it is rooted. Why would it need to be rooted in a gc-only app though? Shouldn't there be strong references instead? Is there a way to un-root the layer if it's not necessary for it to be rooted?
rdar://problem/9749825
--
Michael_______________________________________________
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