@@ -128,19 +128,19 @@ [_connection handleConnection]; } - (id)main { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); [_connection connect]; [self performSelector: @selector(didConnect) onThread: _sourceThread waitUntilDone: false]; - [pool release]; + objc_autoreleasePoolPop(pool); return nil; } @end @@ -316,11 +316,11 @@ [old release]; } - (void)connect { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); XMPPSRVEntry *candidate = nil; XMPPSRVLookup *SRVLookup = nil; OFEnumerator *enumerator; if (_socket != nil) @@ -359,11 +359,11 @@ port: _port]; } [self XMPP_startStream]; - [pool release]; + objc_autoreleasePoolPop(pool); } - (void)handleConnection { char *buffer = [self allocMemoryWithSize: BUFFER_LENGTH]; @@ -375,17 +375,17 @@ exception:)]; } - (void)asyncConnectAndHandle { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); [[[[XMPPConnection_ConnectThread alloc] initWithSourceThread: [OFThread currentThread] connection: self] autorelease] start]; - [pool release]; + objc_autoreleasePoolPop(pool); } - (bool)XMPP_parseBuffer: (const void *)buffer length: (size_t)length { @@ -520,16 +520,14 @@ - (void)sendIQ: (XMPPIQ *)IQ callbackTarget: (id)target selector: (SEL)selector { - OFAutoreleasePool *pool; + void *pool = objc_autoreleasePoolPush(); XMPPCallback *callback; OFString *ID, *key; - pool = [[OFAutoreleasePool alloc] init]; - if ((ID = [IQ ID]) == nil) { ID = [self generateStanzaID]; [IQ setID: ID]; } @@ -541,25 +539,24 @@ callback = [XMPPCallback callbackWithTarget: target selector: selector]; [_callbacks setObject: callback forKey: key]; - [pool release]; + + objc_autoreleasePoolPop(pool); [self sendStanza: IQ]; } #ifdef OF_HAVE_BLOCKS - (void)sendIQ: (XMPPIQ *)IQ callbackBlock: (xmpp_callback_block_t)block { - OFAutoreleasePool *pool; + void *pool = objc_autoreleasePoolPush(); XMPPCallback *callback; OFString *ID, *key; - pool = [[OFAutoreleasePool alloc] init]; - if ((ID = [IQ ID]) == nil) { ID = [self generateStanzaID]; [IQ setID: ID]; } @@ -570,11 +567,12 @@ key = [key stringByAppendingString: ID]; callback = [XMPPCallback callbackWithBlock: block]; [_callbacks setObject: callback forKey: key]; - [pool release]; + + objc_autoreleasePoolPop(pool); [self sendStanza: IQ]; } #endif