Closed GoogleCodeExporter closed 8 years ago
Ok, I'm starting to see the problem. When an NSWindow is finalized, it calls
setWIndow on its views to say that
they no longer belong to it. This ends up calling viewDidMoveToWindow on the
view, which by default does
nothing, but for STRecorderControl does resetTrackingRects. This in turn calls
resetTrackingRects on the
SRRecorderCell, which tries to set a new tracking rectangle passing itself to
addTrackingRect. As the
NSObject.finalize documentation says, passing yourself around to function
during finalize is known as
"resurrection", and is naughty. In fact, finalize really should never refer to
any other objects at all, because
finalization order is undefined.
Original comment by idou...@gmail.com
on 2 Sep 2008 at 1:41
[deleted comment]
[deleted comment]
As hinted by the viewDidMoveToWindow doco, my suggested fix is the following:
// If the control is set to be resizeable in width, this will make sure that
the tracking rects are always updated
- (void)viewDidMoveToWindow
{
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center removeObserver:self];
if ([self window] != nil) {
[center addObserver:self selector:@selector(viewFrameDidChange:)
name:NSViewFrameDidChangeNotification object:self];
[self resetTrackingRects];
}
}
Adding the if () test seems to fix it.
Original comment by idou...@gmail.com
on 3 Sep 2008 at 1:14
being that GC is deprecated I'm marking this one as won't fix.
Original comment by rarich...@gmail.com
on 19 Mar 2012 at 2:51
Original comment by rarich...@gmail.com
on 19 Mar 2012 at 2:52
Firstly, the fix is right there, so why not put it in?
Secondly, who in the heck said GC is deprecated?
Original comment by xpusosto...@gmail.com
on 19 Mar 2012 at 10:07
Original issue reported on code.google.com by
idou...@gmail.com
on 2 Sep 2008 at 12:36