Skip navigation.
 
mlRe: NSView viewWillDraw crash
FROM : Keith Duncan
DATE : Fri Jan 11 11:27:59 2008

> In particular, are you manipulating the view hierarchy -- removing 
> views from it -- from another thread or in any "figure out the rect 
> that needs to be refreshed" code?


Nope, no views are added/removed in any of my code.

> Crashes in CFRelease or -release almost always indicate that some
> object has been over-released. I'd pay special attention to any code
> you have that either creates views or manipulates the view hierarchy
> in other ways. Look for any -release or -autorelease method calls that
> aren't properly balanced.


My thoughts exactly, however...

> Run with NSZombieEnabled to see if you can catch anything that way 
> (unless you're using GC).


...I tried this along with CFZombieLevel, but it didn't log anything 
though. This is a preference pane app with the System Preferences 
started as a custom executable with NSZombie and CFZombieLevel set as 
arguments so that should still work right?

From the original stack trace one of the return address' is in 
NSBox's implementation of viewWillDraw. Now, my interface has two 
boxes, one housing the other and a custom view. To investigate if I 
was perhaps doing something in my custom view to cause the crash I 
implemented viewWillDraw and simply called super - turns out that my 
custom view isn't the problem because its viewWillDraw is never in the 
return stack.

Of course, it is far more likely to be something in my code that is at 
fault that something in the frameworks. The bug is also reproducible 
to a certain extent though it isn't always in the same return stack 
leading me to believe it is in fact a memory management bug. But if I 
can't get NSZombies to work then how am I to proceed?

- Keith

Related mailsAuthorDate
mlNSView viewWillDraw crash Keith Duncan Jan 10, 22:13
mlRe: NSView viewWillDraw crash Bill Bumgarner Jan 10, 22:22
mlRe: NSView viewWillDraw crash j o a r Jan 10, 22:26
mlRe: NSView viewWillDraw crash Clark Cox Jan 10, 22:27
mlRe: NSView viewWillDraw crash Keith Duncan Jan 11, 11:27
mlRe: NSView viewWillDraw crash Corbin Dunn Jan 16, 00:13