mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
make code more robust when there's no autorelease pool.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35706 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
27c13ff71d
commit
fcd6be710e
8 changed files with 88 additions and 73 deletions
|
@ -721,7 +721,7 @@ static Class NSNullClass;
|
|||
static Class NSNumberClass;
|
||||
static Class NSStringClass;
|
||||
|
||||
static NSCharacterSet *escapeSet;
|
||||
static NSMutableCharacterSet *escapeSet;
|
||||
|
||||
static inline void
|
||||
writeTabs(NSMutableString *output, NSInteger tabs)
|
||||
|
@ -902,10 +902,10 @@ writeObject(id obj, NSMutableString *output, NSInteger tabs)
|
|||
NSStringClass = [NSString class];
|
||||
NSDictionaryClass = [NSDictionary class];
|
||||
NSNumberClass = [NSNumber class];
|
||||
escapeSet
|
||||
= [[NSCharacterSet characterSetWithCharactersInString: @"\"\\"] retain];
|
||||
boolN = [[NSNumber numberWithBool: NO] retain];
|
||||
boolY = [[NSNumber numberWithBool: YES] retain];
|
||||
escapeSet = [NSMutableCharacterSet new];
|
||||
[escapeSet addCharactersInString: @"\"\\"];
|
||||
boolN = [[NSNumber alloc] initWithBool: NO];
|
||||
boolY = [[NSNumber alloc] initWithBool: YES];
|
||||
}
|
||||
|
||||
+ (NSData*) dataWithJSONObject: (id)obj
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue