1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 17:47:37 +00:00

possible fix for #2586

This commit is contained in:
Mitchell Livingston 2009-12-14 23:35:55 +00:00
parent 6b98510841
commit 897f344b71

View file

@ -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)