From 0c6c569b6905398669fdf91a484fae4ce4ec5f24 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Wed, 23 Feb 2011 06:18:09 +0000 Subject: [PATCH] (trunk libT) minor cleanup: improve the function names torrentConstructor() and torrentDestructor(). These functions actually allocate/free the memory where these objects reside, so it's clearer to name them torrentNew() and torrentDelete(). --- libtransmission/peer-mgr.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 18a91691c..941af04b4 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -483,7 +483,7 @@ replicationNew( Torrent * t ) } static void -torrentDestructor( void * vt ) +torrentFree( void * vt ) { Torrent * t = vt; @@ -508,8 +508,7 @@ torrentDestructor( void * vt ) static void peerCallbackFunc( tr_peer *, const tr_peer_event *, void * ); static Torrent* -torrentConstructor( tr_peerMgr * manager, - tr_torrent * tor ) +torrentNew( tr_peerMgr * manager, tr_torrent * tor ) { int i; Torrent * t; @@ -2430,7 +2429,7 @@ tr_peerMgrAddTorrent( tr_peerMgr * manager, tr_torrent * tor ) assert( tr_torrentIsLocked( tor ) ); assert( tor->torrentPeers == NULL ); - tor->torrentPeers = torrentConstructor( manager, tor ); + tor->torrentPeers = torrentNew( manager, tor ); } void @@ -2440,7 +2439,7 @@ tr_peerMgrRemoveTorrent( tr_torrent * tor ) assert( tr_torrentIsLocked( tor ) ); stopTorrent( tor->torrentPeers ); - torrentDestructor( tor->torrentPeers ); + torrentFree( tor->torrentPeers ); } void