URL: <http://savannah.gnu.org/bugs/?25572>
Summary: NSSavePanel/NSOpenPanel return an instance variable instead of object copy Project: GNUstep Submitted by: rmottola Submitted on: Thu 12 Feb 2009 11:47:50 PM GMT Category: Gui/AppKit Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: debugging the reason of easydiff Crashing while opening the second file to compare, I traced it to a problem with [NSSavePanel directory]. That method returns just the instance variable _directory. Since the second time the shared instance of the panel is gotten the internal variable gets ASSIGNed, the original object returned the first time gets released, and thus gets invalid. even if this could be worked around in several ways in the applicatioin, I consider ths behaviour unexpected. I thus run the following test on the mac: { NSOpenPanel *panel; NSString *dir; panel = [NSOpenPanel openPanel]; dir = nil; [panel runModalForDirectory: dir file:nil types:nil]; dir = [panel directory]; panel = [NSOpenPanel openPanel]; [panel runModalForDirectory: dir file:nil types:nil]; NSLog(@"dir: %@", dir); NSLog(@"file: %@", [[panel filenames] objectAtIndex:0]); } and it works fine. thus I think gnustep should return an autoreleaed copy of the directory string. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?25572> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-gnustep mailing list Bug-gnustep@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnustep