[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #25572] NSSavePanel/NSOpenPanel return an instance variable instead
From: |
Riccardo mottola |
Subject: |
[bug #25572] NSSavePanel/NSOpenPanel return an instance variable instead of object copy |
Date: |
Thu, 12 Feb 2009 23:47:51 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.9 (KHTML, like Gecko) Safari/312.6 |
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 #25572] NSSavePanel/NSOpenPanel return an instance variable instead of object copy,
Riccardo mottola <=