mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
fix unarchiving bug and tidy
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23275 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c720626d76
commit
684974fbfc
5 changed files with 10 additions and 8 deletions
|
@ -7,6 +7,7 @@
|
||||||
given a bad position. ([compare:]) fix to match MacOS-X
|
given a bad position. ([compare:]) fix to match MacOS-X
|
||||||
* Source/NSObject.m: implement CRASH_ON_ZOMBIE
|
* Source/NSObject.m: implement CRASH_ON_ZOMBIE
|
||||||
* Documentation/Base.gsdoc: document it.
|
* Documentation/Base.gsdoc: document it.
|
||||||
|
* Source/NSArray.m: Fix error in decoding from keyed archive.
|
||||||
|
|
||||||
2006-08-12 Richard Frith-Macdonald <rfm@gnu.org>
|
2006-08-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -1045,7 +1045,7 @@ static Class GSInlineArrayClass;
|
||||||
NSArray *array = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey:
|
NSArray *array = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey:
|
||||||
@"NS.objects"];
|
@"NS.objects"];
|
||||||
|
|
||||||
return array;
|
return RETAIN(array);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1053,7 +1053,8 @@ static Class GSInlineArrayClass;
|
||||||
unsigned c;
|
unsigned c;
|
||||||
|
|
||||||
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &c];
|
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &c];
|
||||||
a = (id)NSAllocateObject(GSInlineArrayClass, sizeof(id)*c, GSObjCZone(self));
|
a = (id)NSAllocateObject(GSInlineArrayClass,
|
||||||
|
sizeof(id)*c, GSObjCZone(self));
|
||||||
a->_contents_array = (id*)&a[1];
|
a->_contents_array = (id*)&a[1];
|
||||||
if (c > 0)
|
if (c > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02111 USA.
|
||||||
|
|
||||||
<title>NSArchiver class reference</title>
|
<title>NSArchiver class reference</title>
|
||||||
$Date$ $Revision$
|
$Date$ $Revision$
|
||||||
|
|
|
@ -312,6 +312,7 @@ static NSMapTable globalClassMap = 0;
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
DESTROY(u);
|
DESTROY(u);
|
||||||
|
DESTROY(o);
|
||||||
[localException raise];
|
[localException raise];
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER
|
NS_ENDHANDLER
|
||||||
|
@ -323,12 +324,9 @@ static NSMapTable globalClassMap = 0;
|
||||||
NSData *d;
|
NSData *d;
|
||||||
id o;
|
id o;
|
||||||
|
|
||||||
// CREATE_AUTORELEASE_POOL(pool);
|
|
||||||
d = [NSData dataWithContentsOfFile: aPath];
|
d = [NSData dataWithContentsOfFile: aPath];
|
||||||
o = [self unarchiveObjectWithData: d];
|
o = [self unarchiveObjectWithData: d];
|
||||||
// RETAIN(o);
|
return o;
|
||||||
// RELEASE(pool);
|
|
||||||
return AUTORELEASE(o);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) allowsKeyedCoding
|
- (BOOL) allowsKeyedCoding
|
||||||
|
|
|
@ -1109,7 +1109,7 @@ quotedFromString(NSString *aString)
|
||||||
[args appendString: quotedFromString(arg)];
|
[args appendString: quotedFromString(arg)];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"ARGS: %@", args);
|
NSLog(@"ARGS: '%@'", args);
|
||||||
w_args = NSZoneMalloc(NSDefaultMallocZone(),
|
w_args = NSZoneMalloc(NSDefaultMallocZone(),
|
||||||
sizeof(wchar_t) * ([args length] + 1));
|
sizeof(wchar_t) * ([args length] + 1));
|
||||||
[args getCharacters: (unichar*)w_args];
|
[args getCharacters: (unichar*)w_args];
|
||||||
|
@ -1198,6 +1198,7 @@ NSLog(@"ARGS: %@", args);
|
||||||
NULL, /* thread attrs */
|
NULL, /* thread attrs */
|
||||||
1, /* inherit handles */
|
1, /* inherit handles */
|
||||||
CREATE_NO_WINDOW|CREATE_UNICODE_ENVIRONMENT, /* creation flags */
|
CREATE_NO_WINDOW|CREATE_UNICODE_ENVIRONMENT, /* creation flags */
|
||||||
|
//CREATE_UNICODE_ENVIRONMENT, /* creation flags */
|
||||||
envp, /* env block */
|
envp, /* env block */
|
||||||
(const unichar*)[[self currentDirectoryPath] fileSystemRepresentation],
|
(const unichar*)[[self currentDirectoryPath] fileSystemRepresentation],
|
||||||
&start_info,
|
&start_info,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue