From 4834dc4b1325411dc792a46c800b0605372c96fd Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 23 Sep 2007 19:24:06 +0000 Subject: [PATCH] fix crash-on-shutdown --- libtransmission/torrent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 );