diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 4fc961813..b7e3717c7 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -1004,6 +1004,8 @@ tr_torrentFree( tr_torrent * tor ) tr_sharedLock( h->shared ); + tr_peerMgrRemoveTorrent( h->peerMgr, tor->info.hash ); + tr_lockFree( tor->lock ); tr_cpClose( tor->completion ); @@ -1032,8 +1034,6 @@ tr_torrentFree( tr_torrent * tor ) tr_inf( "closing torrent %s... %d torrents left", tor->info.name, h->torrentCount ); - tr_peerMgrRemoveTorrent( h->peerMgr, tor->info.hash ); - tr_metainfoFree( inf ); tr_free( tor );