Changeset 7827


Ignore:
Timestamp:
Feb 4, 2009, 6:54:29 PM (12 years ago)
Author:
charles
Message:

(trunk libT) maybe fix the crasher (on the mac) that I introduced this morning. or maybe not. hard to know w/o being on a mac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tracker.c

    r7826 r7827  
    837837struct tr_tracker_handle
    838838{
     839    tr_bool     shutdownHint;
    839840    int         runningCount;
    840841    tr_timer *  pulseTimer;
     
    855856void
    856857tr_trackerSessionClose( tr_session * session )
     858{
     859    assert( tr_isSession( session ) );
     860
     861    session->tracker->shutdownHint = TRUE;
     862}
     863
     864static void
     865tr_trackerSessionDestroy( tr_session * session )
    857866{
    858867    if( session && session->tracker )
     
    944953    const time_t               now = time( NULL );
    945954
    946     if( !session->tracker )
     955    if( !th )
    947956        return FALSE;
    948957
     
    979988
    980989    /* free the tracker manager if no torrents are left */
    981     if( ( session->tracker )
    982       && ( session->tracker->runningCount < 1 )
    983       && ( tr_sessionCountTorrents( session ) == 0 ) )
    984     {
    985         tr_trackerSessionClose( session );
    986     }
    987 
    988     /* if there are still running torrents (as indicated by
    989      * the existence of the tracker manager) then keep the
    990      * trackerPulse() timer alive */
    991     return session->tracker != NULL;
     990    if(    ( th != NULL )
     991        && ( th->shutdownHint != FALSE )
     992        && ( th->runningCount < 1 )
     993        && ( tr_sessionCountTorrents( session ) == 0 ) )
     994    {
     995        tr_trackerSessionDestroy( session );
     996        return FALSE;
     997    }
     998
     999    return TRUE;
    9921000}
    9931001
Note: See TracChangeset for help on using the changeset viewer.