@@ -652,10 +652,11 @@ return [self JSONValueWithDepthLimit: 32]; } - (id)JSONValueWithDepthLimit: (size_t)depthLimit { + void *pool = objc_autoreleasePoolPush(); const char *pointer = [self UTF8String]; const char *stop = pointer + [self UTF8StringLength]; id object; size_t line = 1; @@ -664,8 +665,12 @@ if (pointer < stop || object == nil) @throw [OFInvalidJSONException exceptionWithString: self line: line]; - return object; + [object retain]; + + objc_autoreleasePoolPop(pool); + + return [object autorelease]; } @end