From 897f344b7162454d1dfc9cebefa0aa69434d0c7a Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Mon, 14 Dec 2009 23:35:55 +0000 Subject: [PATCH] possible fix for #2586 --- macosx/Controller.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/macosx/Controller.m b/macosx/Controller.m index 6102e4949..87426c17d 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1355,6 +1355,18 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy [fTorrents removeObjectsInArray: torrents]; + //if not removed from displayed torrents, updateTorrentsInQueue might cause a crash + if ([fDisplayedTorrents count] > 0) + { + if ([[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [TorrentGroup class]]) + { + for (TorrentGroup * group in fDisplayedTorrents) + [[group torrents] removeObjectsInArray: torrents]; + } + else + [fDisplayedTorrents removeObjectsInArray: torrents]; + } + for (Torrent * torrent in torrents) { //let's expand all groups that have removed items - they either don't exist anymore, are already expanded, or are collapsed (rpc)