Skip navigation.
 
mlNon-document app's NSWindow keeps getting retained
FROM : David Dunham
DATE : Tue Feb 05 20:05:12 2008

I've got a Cocoa app that manually creates an NSWindow (it's an 
easier fit for a cross-platform engine). From my debugging, it 
appears that every time I click another app's window, the retain 
count on my NSWindow goes up by 2 (I have a windowDidResignKey 
delegate which prints the retain count). I don't make an 
NSWindowController.

If I override -[NSApplication windows] and return an empty array, the 
regain count doesn't keep climbing. This seems kind of odd.

The behavior is happening on 10.4.11 and 10.5.1.

I suspect I must be doing something wrong, but can't figure out what.

David Dunham
Voice/Fax: 206 783 7404            http://www.pensee.com/dunham/
Imagination is more important than knowledge. -- Albert Einstein

Related mailsAuthorDate
mlNon-document app's NSWindow keeps getting retained David Dunham Feb 5, 20:05
mlRe: Non-document app's NSWindow keeps getting retained David Dunham Feb 5, 22:12
mlRe: Non-document app's NSWindow keeps getting retained Scott Stevenson Feb 5, 23:04
mlRe: Non-document app's NSWindow keeps getting retained j o a r Feb 6, 00:28
mlRe: Non-document app's NSWindow keeps getting retained David Dunham Feb 6, 04:57
mlRe: Non-document app's NSWindow keeps getting retained Clark Cox Feb 6, 06:27
mlRe: Non-document app's NSWindow keeps getting retained David Dunham Feb 6, 08:10
mlRe: Non-document app's NSWindow keeps getting retained Scott Stevenson Feb 6, 08:45