|
From: | Wolfgang Lux |
Subject: | Re: r27812 - in /libs/gui/trunk: ChangeLog Source/NSBundleAdditions.m |
Date: | Thu, 11 Mar 2010 19:46:44 +0100 |
Fred Kiefer wrote:
Am 03.03.2010 10:06, schrieb Wolfgang Lux:Fred Kiefer wrote:I am not that sure about this.When I changed to the current code it was to get the Beans application working with GNUstep. There we had the case the components loaded viaNIB where released to early by GNUstep.We rather should make sure we handle all cases as similar as Apple aspossible. Richard already added a simple test for KVC to see, if our behaviour there matches Cocoa. We will need a similar check for the NSNibOutletConnector.If we want to be as compatible with Apple as possible, it seems that the best way to proceed would be to restore the old code. I ran a quick testthis morning, and it seems that Cocoa is calling a -setXxx: method if present. However, it does ignore private -_setXxx: methods, which KVCseems to use, though only for backward compatibility. Furthermore, Cocoa insists on the attribute name being xxx and, unlike KVC, does not assignnib components to a attribute named _xxx.So, if we want to be as compatible with Apple as possible, it seems thatthe best way to proceed would be to restore the old code. Or maybe to move the whole code to gnustep-base and export it from there as a GNUstep extension.Looks like you are right. I still didn't find the time to test it myself on an Apple machine. What puzzles me is why we had that issue with Beanwhile it seems to work well on Cocoa...
I had a quick look into this. After reverting the code in - establishConnection I observe a crash in Bean under GNUstep when closing a document window. This crash happens in MyDocument - updateInspectorController:, which attempts to access views of the nib after the window has been closed and released. Apparently, the views are not (and should not be) valid at this time. From the data gathered by Apple's ObjectAlloc, it seems that this code does not crash under Cocoa because Apple manages to deallocate the objects involved in a different order. In particular, when the last window of a document is closed the document is released and deallocated *before* the last window controller and its window are released and deallocated. I'll try to have a closer look at this when I find a bit more time.
Wolfgang
[Prev in Thread] | Current Thread | [Next in Thread] |