From 5f9ec561e65c1fbf87010699ae184b3a32662e3b Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 25 May 2008 17:34:02 +0000 Subject: [PATCH] a little work with rpc --- macosx/Controller.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index a2b821ba5..ece15f9a4 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -828,7 +828,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy if (add) { - [torrent setOrderValue: [fTorrents count]-1]; //ensure that queue order is always sequential + [torrent setOrderValue: [fTorrents count]]; //ensure that queue order is always sequential [torrent update]; [fTorrents addObject: torrent]; @@ -4147,8 +4147,10 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy - (void) rpcCallback: (tr_rpc_callback_type) type forTorrentStruct: (struct tr_torrent *) torrentStruct { + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + //get the torrent - if (torrentStruct != NULL) + if (torrentStruct != NULL && type != TR_RPC_TORRENT_ADDED) { NSEnumerator * enumerator = [fTorrents objectEnumerator]; Torrent * torrent; @@ -4178,6 +4180,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy case TR_RPC_SESSION_CHANGED: break; } + + [pool release]; } /*- (void) ipcQuit -- 2.40.0