Stop using OFAutoreleasePool
This commit is contained in:
parent
cb5f6bfe40
commit
631b4e1a9d
7 changed files with 54 additions and 54 deletions
|
@ -130,7 +130,7 @@ OF_ASSUME_NONNULL_END
|
||||||
|
|
||||||
- (id)main
|
- (id)main
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
|
|
||||||
[_connection connect];
|
[_connection connect];
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ OF_ASSUME_NONNULL_END
|
||||||
onThread: _sourceThread
|
onThread: _sourceThread
|
||||||
waitUntilDone: false];
|
waitUntilDone: false];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ OF_ASSUME_NONNULL_END
|
||||||
|
|
||||||
- (void)connect
|
- (void)connect
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
XMPPSRVEntry *candidate = nil;
|
XMPPSRVEntry *candidate = nil;
|
||||||
XMPPSRVLookup *SRVLookup = nil;
|
XMPPSRVLookup *SRVLookup = nil;
|
||||||
OFEnumerator *enumerator;
|
OFEnumerator *enumerator;
|
||||||
|
@ -361,7 +361,7 @@ OF_ASSUME_NONNULL_END
|
||||||
|
|
||||||
[self XMPP_startStream];
|
[self XMPP_startStream];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)handleConnection
|
- (void)handleConnection
|
||||||
|
@ -377,13 +377,13 @@ OF_ASSUME_NONNULL_END
|
||||||
|
|
||||||
- (void)asyncConnectAndHandle
|
- (void)asyncConnectAndHandle
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
|
|
||||||
[[[[XMPPConnection_ConnectThread alloc]
|
[[[[XMPPConnection_ConnectThread alloc]
|
||||||
initWithSourceThread: [OFThread currentThread]
|
initWithSourceThread: [OFThread currentThread]
|
||||||
connection: self] autorelease] start];
|
connection: self] autorelease] start];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (bool)XMPP_parseBuffer: (const void *)buffer
|
- (bool)XMPP_parseBuffer: (const void *)buffer
|
||||||
|
@ -522,12 +522,10 @@ OF_ASSUME_NONNULL_END
|
||||||
callbackTarget: (id)target
|
callbackTarget: (id)target
|
||||||
selector: (SEL)selector
|
selector: (SEL)selector
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool;
|
void *pool = objc_autoreleasePoolPush();
|
||||||
XMPPCallback *callback;
|
XMPPCallback *callback;
|
||||||
OFString *ID, *key;
|
OFString *ID, *key;
|
||||||
|
|
||||||
pool = [[OFAutoreleasePool alloc] init];
|
|
||||||
|
|
||||||
if ((ID = [IQ ID]) == nil) {
|
if ((ID = [IQ ID]) == nil) {
|
||||||
ID = [self generateStanzaID];
|
ID = [self generateStanzaID];
|
||||||
[IQ setID: ID];
|
[IQ setID: ID];
|
||||||
|
@ -543,7 +541,8 @@ OF_ASSUME_NONNULL_END
|
||||||
selector: selector];
|
selector: selector];
|
||||||
[_callbacks setObject: callback
|
[_callbacks setObject: callback
|
||||||
forKey: key];
|
forKey: key];
|
||||||
[pool release];
|
|
||||||
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
[self sendStanza: IQ];
|
[self sendStanza: IQ];
|
||||||
}
|
}
|
||||||
|
@ -552,12 +551,10 @@ OF_ASSUME_NONNULL_END
|
||||||
- (void)sendIQ: (XMPPIQ *)IQ
|
- (void)sendIQ: (XMPPIQ *)IQ
|
||||||
callbackBlock: (xmpp_callback_block_t)block
|
callbackBlock: (xmpp_callback_block_t)block
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool;
|
void *pool = objc_autoreleasePoolPush();
|
||||||
XMPPCallback *callback;
|
XMPPCallback *callback;
|
||||||
OFString *ID, *key;
|
OFString *ID, *key;
|
||||||
|
|
||||||
pool = [[OFAutoreleasePool alloc] init];
|
|
||||||
|
|
||||||
if ((ID = [IQ ID]) == nil) {
|
if ((ID = [IQ ID]) == nil) {
|
||||||
ID = [self generateStanzaID];
|
ID = [self generateStanzaID];
|
||||||
[IQ setID: ID];
|
[IQ setID: ID];
|
||||||
|
@ -572,7 +569,8 @@ OF_ASSUME_NONNULL_END
|
||||||
callback = [XMPPCallback callbackWithBlock: block];
|
callback = [XMPPCallback callbackWithBlock: block];
|
||||||
[_callbacks setObject: callback
|
[_callbacks setObject: callback
|
||||||
forKey: key];
|
forKey: key];
|
||||||
[pool release];
|
|
||||||
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
[self sendStanza: IQ];
|
[self sendStanza: IQ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,22 +124,22 @@
|
||||||
- (void)setStringValue: (OFString *)string
|
- (void)setStringValue: (OFString *)string
|
||||||
forPath: (OFString *)path
|
forPath: (OFString *)path
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
|
|
||||||
[self XMPP_setObject: string
|
[self XMPP_setObject: string
|
||||||
forPath: path];
|
forPath: path];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (OFString *)stringValueForPath: (OFString *)path
|
- (OFString *)stringValueForPath: (OFString *)path
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
OFString *string;
|
OFString *string;
|
||||||
|
|
||||||
string = [self XMPP_objectForPath: path];
|
string = [self XMPP_objectForPath: path];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
@ -147,22 +147,22 @@
|
||||||
- (void)setBooleanValue: (bool)boolean
|
- (void)setBooleanValue: (bool)boolean
|
||||||
forPath: (OFString *)path
|
forPath: (OFString *)path
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
|
|
||||||
[self XMPP_setObject: [OFNumber numberWithBool: boolean]
|
[self XMPP_setObject: [OFNumber numberWithBool: boolean]
|
||||||
forPath: path];
|
forPath: path];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (bool)booleanValueForPath: (OFString *)path
|
- (bool)booleanValueForPath: (OFString *)path
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
bool boolean;
|
bool boolean;
|
||||||
|
|
||||||
boolean = [[self XMPP_objectForPath: path] boolValue];
|
boolean = [[self XMPP_objectForPath: path] boolValue];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return boolean;
|
return boolean;
|
||||||
}
|
}
|
||||||
|
@ -170,22 +170,22 @@
|
||||||
- (void)setIntegerValue: (intmax_t)integer
|
- (void)setIntegerValue: (intmax_t)integer
|
||||||
forPath: (OFString *)path
|
forPath: (OFString *)path
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
|
|
||||||
[self XMPP_setObject: [OFNumber numberWithIntMax: integer]
|
[self XMPP_setObject: [OFNumber numberWithIntMax: integer]
|
||||||
forPath: path];
|
forPath: path];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (intmax_t)integerValueForPath: (OFString *)path
|
- (intmax_t)integerValueForPath: (OFString *)path
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
intmax_t integer;
|
intmax_t integer;
|
||||||
|
|
||||||
integer = [[self XMPP_objectForPath: path] intMaxValue];
|
integer = [[self XMPP_objectForPath: path] intMaxValue];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return integer;
|
return integer;
|
||||||
}
|
}
|
||||||
|
@ -193,22 +193,22 @@
|
||||||
- (void)setArray: (OFArray *)array
|
- (void)setArray: (OFArray *)array
|
||||||
forPath: (OFString *)path
|
forPath: (OFString *)path
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
|
|
||||||
[self XMPP_setObject: array
|
[self XMPP_setObject: array
|
||||||
forPath: path];
|
forPath: path];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (OFArray *)arrayForPath: (OFString *)path
|
- (OFArray *)arrayForPath: (OFString *)path
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
OFArray *array;
|
OFArray *array;
|
||||||
|
|
||||||
array = [self XMPP_objectForPath: path];
|
array = [self XMPP_objectForPath: path];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
@ -216,22 +216,22 @@
|
||||||
- (void)setDictionary: (OFDictionary *)dictionary
|
- (void)setDictionary: (OFDictionary *)dictionary
|
||||||
forPath: (OFString *)path
|
forPath: (OFString *)path
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
|
|
||||||
[self XMPP_setObject: dictionary
|
[self XMPP_setObject: dictionary
|
||||||
forPath: path];
|
forPath: path];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (OFDictionary *)dictionaryForPath: (OFString *)path
|
- (OFDictionary *)dictionaryForPath: (OFString *)path
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
OFDictionary *dictionary;
|
OFDictionary *dictionary;
|
||||||
|
|
||||||
dictionary = [self XMPP_objectForPath: path];
|
dictionary = [self XMPP_objectForPath: path];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return dictionary;
|
return dictionary;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
{
|
{
|
||||||
XMPPIQ *ret = [XMPPIQ IQWithType: @"error"
|
XMPPIQ *ret = [XMPPIQ IQWithType: @"error"
|
||||||
ID: [self ID]];
|
ID: [self ID]];
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
OFXMLElement *error = [OFXMLElement elementWithName: @"error"
|
OFXMLElement *error = [OFXMLElement elementWithName: @"error"
|
||||||
namespace: XMPP_NS_CLIENT];
|
namespace: XMPP_NS_CLIENT];
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
[ret setTo: [self from]];
|
[ret setTo: [self from]];
|
||||||
[ret setFrom: nil];
|
[ret setFrom: nil];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
- (bool)broadcastSelector: (SEL)selector
|
- (bool)broadcastSelector: (SEL)selector
|
||||||
withObject: (id)object
|
withObject: (id)object
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
OFMutableData *currentDelegates = [[_delegates copy] autorelease];
|
OFMutableData *currentDelegates = [[_delegates copy] autorelease];
|
||||||
id *items = [currentDelegates items];
|
id *items = [currentDelegates items];
|
||||||
size_t i, count = [currentDelegates count];
|
size_t i, count = [currentDelegates count];
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
handled |= imp(responder, selector, object);
|
handled |= imp(responder, selector, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@
|
||||||
withObject: (id)object1
|
withObject: (id)object1
|
||||||
withObject: (id)object2
|
withObject: (id)object2
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
OFMutableData *currentDelegates = [[_delegates copy] autorelease];
|
OFMutableData *currentDelegates = [[_delegates copy] autorelease];
|
||||||
id *items = [currentDelegates items];
|
id *items = [currentDelegates items];
|
||||||
size_t i, count = [currentDelegates count];
|
size_t i, count = [currentDelegates count];
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
handled |= imp(responder, selector, object1, object2);
|
handled |= imp(responder, selector, object1, object2);
|
||||||
}
|
}
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
|
@ -353,18 +353,18 @@ OF_ASSUME_NONNULL_END
|
||||||
}
|
}
|
||||||
|
|
||||||
for (OFXMLElement *element in [rosterElement children]) {
|
for (OFXMLElement *element in [rosterElement children]) {
|
||||||
OFAutoreleasePool *pool;
|
void *pool = objc_autoreleasePoolPush();
|
||||||
XMPPRosterItem *rosterItem;
|
XMPPRosterItem *rosterItem;
|
||||||
|
|
||||||
if (![[element name] isEqual: @"item"] ||
|
if (![[element name] isEqual: @"item"] ||
|
||||||
![[element namespace] isEqual: XMPP_NS_ROSTER])
|
![[element namespace] isEqual: XMPP_NS_ROSTER])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pool = [[OFAutoreleasePool alloc] init];
|
|
||||||
rosterItem = [self XMPP_rosterItemWithXMLElement: element];
|
rosterItem = [self XMPP_rosterItemWithXMLElement: element];
|
||||||
|
|
||||||
[self XMPP_updateRosterItem: rosterItem];
|
[self XMPP_updateRosterItem: rosterItem];
|
||||||
[pool release];
|
|
||||||
|
objc_autoreleasePoolPop(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([connection supportsRosterVersioning] && rosterElement != nil) {
|
if ([connection supportsRosterVersioning] && rosterElement != nil) {
|
||||||
|
|
|
@ -433,7 +433,7 @@ OF_ASSUME_NONNULL_END
|
||||||
- (const uint8_t *)XMPP_HMACWithKey: (OFData *)key
|
- (const uint8_t *)XMPP_HMACWithKey: (OFData *)key
|
||||||
data: (OFData *)data
|
data: (OFData *)data
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
OFMutableData *k = [OFMutableData data];
|
OFMutableData *k = [OFMutableData data];
|
||||||
size_t i, kSize, blockSize = [_hashType blockSize];
|
size_t i, kSize, blockSize = [_hashType blockSize];
|
||||||
uint8_t *kI = NULL, *kO = NULL;
|
uint8_t *kI = NULL, *kO = NULL;
|
||||||
|
@ -480,7 +480,8 @@ OF_ASSUME_NONNULL_END
|
||||||
}
|
}
|
||||||
|
|
||||||
[hashO retain];
|
[hashO retain];
|
||||||
[pool release];
|
|
||||||
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return [[hashO autorelease] digest];
|
return [[hashO autorelease] digest];
|
||||||
}
|
}
|
||||||
|
@ -489,7 +490,7 @@ OF_ASSUME_NONNULL_END
|
||||||
salt: (OFData *)salt
|
salt: (OFData *)salt
|
||||||
iterationCount: (intmax_t)i
|
iterationCount: (intmax_t)i
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
size_t digestSize = [_hashType digestSize];
|
size_t digestSize = [_hashType digestSize];
|
||||||
uint8_t *result = NULL;
|
uint8_t *result = NULL;
|
||||||
const uint8_t *u, *uOld;
|
const uint8_t *u, *uOld;
|
||||||
|
@ -516,7 +517,9 @@ OF_ASSUME_NONNULL_END
|
||||||
[tmp addItems: uOld
|
[tmp addItems: uOld
|
||||||
count: digestSize];
|
count: digestSize];
|
||||||
|
|
||||||
[pool releaseObjects]; // releases uOld and previous tmp
|
/* releases uOld and previous tmp */
|
||||||
|
objc_autoreleasePoolPop(pool);
|
||||||
|
pool = objc_autoreleasePoolPush();
|
||||||
[tmp autorelease];
|
[tmp autorelease];
|
||||||
|
|
||||||
u = [self XMPP_HMACWithKey: str
|
u = [self XMPP_HMACWithKey: str
|
||||||
|
@ -535,7 +538,8 @@ OF_ASSUME_NONNULL_END
|
||||||
}
|
}
|
||||||
|
|
||||||
[ret retain];
|
[ret retain];
|
||||||
[pool release];
|
|
||||||
|
objc_autoreleasePoolPop(pool);
|
||||||
|
|
||||||
return [ret autorelease];
|
return [ret autorelease];
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,7 +182,7 @@ OF_ASSUME_NONNULL_END
|
||||||
|
|
||||||
- (void)XMPP_lookup
|
- (void)XMPP_lookup
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
|
void *pool = objc_autoreleasePoolPush();
|
||||||
unsigned char *answer = NULL;
|
unsigned char *answer = NULL;
|
||||||
size_t pageSize = [OFSystemInfo pageSize];
|
size_t pageSize = [OFSystemInfo pageSize];
|
||||||
OFString *request;
|
OFString *request;
|
||||||
|
@ -235,12 +235,12 @@ OF_ASSUME_NONNULL_END
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)XMPP_addEntry: (XMPPSRVEntry *)entry
|
- (void)XMPP_addEntry: (XMPPSRVEntry *)entry
|
||||||
{
|
{
|
||||||
OFAutoreleasePool *pool;
|
void *pool = objc_autoreleasePoolPush();
|
||||||
OFList *subList;
|
OFList *subList;
|
||||||
of_list_object_t *iter;
|
of_list_object_t *iter;
|
||||||
|
|
||||||
|
@ -266,8 +266,6 @@ OF_ASSUME_NONNULL_END
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pool = [[OFAutoreleasePool alloc] init];
|
|
||||||
|
|
||||||
subList = [OFList list];
|
subList = [OFList list];
|
||||||
[subList appendObject: entry];
|
[subList appendObject: entry];
|
||||||
|
|
||||||
|
@ -277,7 +275,7 @@ OF_ASSUME_NONNULL_END
|
||||||
else
|
else
|
||||||
[_list appendObject: subList];
|
[_list appendObject: subList];
|
||||||
|
|
||||||
[pool release];
|
objc_autoreleasePoolPop(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (OFEnumerator *)objectEnumerator
|
- (OFEnumerator *)objectEnumerator
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue