(trunk libT) fix assertion-on-shutdown failure reported by livings

This commit is contained in:
Charles Kerr 2010-01-13 01:21:26 +00:00
parent 1f79353107
commit 86a5e6be8a
1 changed files with 9 additions and 9 deletions

View File

@ -604,18 +604,18 @@ tr_fdFileClose( tr_session * session,
void void
tr_fdTorrentClose( tr_session * session, int torrentId ) 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( 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 ) for( o=gFd->openFiles, end=o+gFd->openFileLimit; o!=end; ++o )
if( fileIsOpen( o ) && ( o->torrentId == torrentId ) ) if( fileIsOpen( o ) && ( o->torrentId == torrentId ) )
TrCloseFile( o ); TrCloseFile( o );
}
} }
/*** /***