1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-08 21:04:25 +00:00

Free even more memory.

This commit is contained in:
Mitchell Livingston 2006-08-13 21:24:23 +00:00
parent 62d9f1ebb1
commit f6eea9e591
3 changed files with 8 additions and 2 deletions

View file

@ -506,8 +506,12 @@ tr_peer_stat_t * tr_torrentPeers( tr_torrent_t * tor, int * peerCount )
return peers;
}
void tr_torrentPeersFree( tr_peer_stat_t * peers )
void tr_torrentPeersFree( tr_peer_stat_t * peers, int peerCount )
{
int i;
for (i = 0; i < peerCount; i++)
free(peers[i].client);
free( peers );
}

View file

@ -215,7 +215,7 @@ tr_stat_t * tr_torrentStat( tr_torrent_t * );
***********************************************************************/
typedef struct tr_peer_stat_s tr_peer_stat_t;
tr_peer_stat_t * tr_torrentPeers( tr_torrent_t *, int * peerCount );
void tr_torrentPeersFree( tr_peer_stat_t * );
void tr_torrentPeersFree( tr_peer_stat_t *, int peerCount );
/***********************************************************************
* tr_torrentAvailability

View file

@ -534,6 +534,8 @@
}
//NSLog(@"%d", tr_peerId(peer));
tr_torrentPeersFree(peers, totalPeers);
return peerDics;
}