Re: Can I tell which object is retaining my window?
Re: Can I tell which object is retaining my window?
- Subject: Re: Can I tell which object is retaining my window?
- From: email@hidden
- Date: Sun, 30 Jul 2006 15:59:53 +0100
Well, my init calls the designated initialiser, but again, it was
working fine until this morning.
I guess I should use a different name to init? It just seemed a lot simpler...
- (id)init {
id newSelf = [super initWithContentRect:NSMakeRect(0, 0, 168, 100)
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO];
[newSelf setOpaque:YES];
[newSelf setBackgroundColor:[NSColor whiteColor]];
[newSelf setAlphaValue:0.1];
[newSelf setMovableByWindowBackground:YES];
[newSelf setHasShadow:YES];
return newSelf;
}
Quoting Mike Abdullah <email@hidden>:
And, come to think of it:
Presumably DashboardWindow is a subclass of NSWindow? If so, you
shouldn't use -init. The designated initialiser is:
- initWithContentRect:styleMask:backing:defer:
Mike.
On 30 Jul 2006, at 15:40, email@hidden wrote:
I've got an application that was working fine until today, and now
one of the temporary windows I create is being retained. A lot.
Sample log, after I subclassed the retain and release methods to do logging:
2006-07-30 15:28:54.349 Flix[2674] DashboardWindow retained: 1
2006-07-30 15:28:54.359 Flix[2674] DashboardWindow released: 2
2006-07-30 15:28:54.367 Flix[2674] DashboardWindow retained: 1
2006-07-30 15:28:54.376 Flix[2674] DashboardWindow released: 2
2006-07-30 15:28:54.388 Flix[2674] DashboardWindow retained: 1
2006-07-30 15:28:54.406 Flix[2674] DashboardWindow retained: 2
2006-07-30 15:28:54.415 Flix[2674] DashboardWindow retained: 3
2006-07-30 15:28:54.423 Flix[2674] DashboardWindow released: 4
2006-07-30 15:28:54.433 Flix[2674] DashboardWindow retained: 3
2006-07-30 15:28:54.441 Flix[2674] DashboardWindow released: 4
2006-07-30 15:28:54.452 Flix[2674] DashboardWindow retained: 3
2006-07-30 15:28:54.461 Flix[2674] DashboardWindow released: 4
2006-07-30 15:28:54.470 Flix[2674] DashboardWindow retained: 3
2006-07-30 15:28:54.479 Flix[2674] DashboardWindow released: 4
2006-07-30 15:28:54.488 Flix[2674] DashboardWindow retained: 3
2006-07-30 15:28:54.497 Flix[2674] DashboardWindow released: 4
2006-07-30 15:28:54.506 Flix[2674] DashboardWindow retained: 3
2006-07-30 15:28:54.515 Flix[2674] DashboardWindow released: 4
2006-07-30 15:28:54.523 Flix[2674] DashboardWindow retained: 3
2006-07-30 15:28:54.524 Flix[2674] DashboardWindow released: 4
And so on. I'm creating the window in code like so:
floatingWindow = [[[DashboardWindow alloc] init] retain];
And later, releasing it normally:
[floatingWindow release];
So, as far as I can tell - something else is sending retain
messages to my window. Is there any way to find out what it is?
Even just what class it is would be helpful.
When my main window is key (not the floating one), the floating
window seems to receive a retain/release every time i move the mouse!
I'm not even responding to mouse moved events. The closest I'm
doing is a trackingRect on the floating window.
Hope someone can shed some light.
Many Thanks!
- Drarok
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden