From 86a5e6be8a7f26f9474df4160667f85391e25081 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 13 Jan 2010 01:21:26 +0000 Subject: [PATCH] (trunk libT) fix assertion-on-shutdown failure reported by livings --- libtransmission/fdlimit.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c index e009f3533..f75ab07e0 100644 --- a/libtransmission/fdlimit.c +++ b/libtransmission/fdlimit.c @@ -604,18 +604,18 @@ tr_fdFileClose( tr_session * session, void tr_fdTorrentClose( tr_session * session, int torrentId ) { - struct tr_openfile * o; - struct tr_fdInfo * gFd; - const struct tr_openfile * end; - assert( tr_isSession( session ) ); - assert( session->fdInfo != NULL ); - gFd = session->fdInfo; + if( session->fdInfo != NULL ) + { + struct tr_openfile * o; + const struct tr_openfile * end; + struct tr_fdInfo * gFd = session->fdInfo; - for( o=gFd->openFiles, end=o+gFd->openFileLimit; o!=end; ++o ) - if( fileIsOpen( o ) && ( o->torrentId == torrentId ) ) - TrCloseFile( o ); + for( o=gFd->openFiles, end=o+gFd->openFileLimit; o!=end; ++o ) + if( fileIsOpen( o ) && ( o->torrentId == torrentId ) ) + TrCloseFile( o ); + } } /***