diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 646e56188..fb8767e44 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -907,8 +907,6 @@ tr_torrentFree( tr_torrent_t * tor ) tr_sharedLock( h->shared ); - h->torrentCount--; - tr_rwClose( &tor->lock ); tr_cpClose( tor->completion ); @@ -931,6 +929,8 @@ tr_torrentFree( tr_torrent_t * tor ) tr_free( tor ); + h->torrentCount--; + tr_sharedUnlock( h->shared ); }