Hi, Fred Kiefer wrote:
the only point I was making is that "commenting out" the setting of the delegate made me loose the windowWillClose notification, failing the release mechanism. I did not investigate why.I need to correct myself. If I don't set the delegate, i don't get windowWillClose, thus no deallocation of the Controller and the Window is triggered. Thus it clearly avoids all the problem anyway. No deallocation no problem:) But that wasn't the original goal.I am not sure I can follow that argument. Please have a look at the code in NSWindowcontroller. Look at the method setWindow. There we make sure we get the NSWindowWillCloseNotification. There still might be a reason, why the controller should be the delegate of the window, but is it really this one?
I did something further though. IN my other mail I supposed that setting the delegate to self in the controller is equivalent to setting it to NSOwner in the NIB. Now I tried to remove most of the GS-only code-path and use the NIB directly, as on Mac! It may be ugly, but at least we debug the same code path and not a supposed-same code path.
I then get this crash:
#0 0x2906cc47 in objc_msgSend () from /usr/local/lib/libobjc.so.4.6
#1 0x287d56a4 in -[NSApplication(Private) _targetForAction:window:] (
_cmd=0x28a77ae0, window=0x28a77918) at NSApplication.m:3891
#2 0x287d57af in -[NSApplication(Private)
_targetForAction:keyWindow:mainWindow:] (self=0x2b8b6638,
_cmd=0x28a77a80, aSelector=<value optimized out>,
keyWindow=<value optimized out>, mainWindow=<value optimized out>)
at NSApplication.m:3936
#3 0x287d1ff3 in -[NSApplication targetForAction:] (self=0x2b8b6638,
_cmd=0x28a77590) at NSApplication.m:2297
#4 0x287d1f72 in -[NSApplication targetForAction:to:from:] (
self=<value optimized out>, _cmd=0x28aafd08,
theAction=<value optimized out>, theTarget=<value optimized out>,
sender=<value optimized out>) at NSApplication.m:2273
#5 0x2887fcf1 in -[NSMenu update] (self=<value optimized out>,
_cmd=0x28ab0060) at NSMenu.m:1157
#6 0x2887fc03 in -[NSMenu update] (self=<value optimized out>,
_cmd=0x28a77a20) at NSMenu.m:1152
#7 0x287d5973 in -[NSApplication(Private) _windowDidBecomeKey:] (
self=<value optimized out>, _cmd=0x28a777f0, notification=0x2bd496c8)
at NSApplication.m:3986
#8 0x28d87de8 in -[NSObject performSelector:withObject:] (self=0x2b8b6638,
_cmd=<value optimized out>, aSelector=0x28a777f0, anObject=0x28a77918)
at NSObject.m:2046
#9 0x28d79dd1 in -[NSNotificationCenter _postAndRelease:] (
which looks the same to me.
Riccardo
<<attachment: riccardo_mottola.vcf>>
_______________________________________________ Discuss-gnustep mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
