Ignore:
Timestamp:
Jan 13, 2010, 1:21:26 AM (12 years ago)
Author:
charles
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r9898 r9922  
    605605tr_fdTorrentClose( tr_session * session, int torrentId )
    606606{
    607     struct tr_openfile * o;
    608     struct tr_fdInfo * gFd;
    609     const struct tr_openfile * end;
    610 
    611     assert( tr_isSession( session ) );
    612     assert( session->fdInfo != NULL );
    613 
    614     gFd = session->fdInfo;
    615 
    616     for( o=gFd->openFiles, end=o+gFd->openFileLimit; o!=end; ++o )
    617         if( fileIsOpen( o ) && ( o->torrentId == torrentId ) )
    618             TrCloseFile( o );
     607    assert( tr_isSession( session ) );
     608
     609    if( session->fdInfo != NULL )
     610    {
     611        struct tr_openfile * o;
     612        const struct tr_openfile * end;
     613        struct tr_fdInfo * gFd = session->fdInfo;
     614
     615        for( o=gFd->openFiles, end=o+gFd->openFileLimit; o!=end; ++o )
     616            if( fileIsOpen( o ) && ( o->torrentId == torrentId ) )
     617                TrCloseFile( o );
     618    }
    619619}
    620620
Note: See TracChangeset for help on using the changeset viewer.