Changeset 5714


Ignore:
Timestamp:
Apr 28, 2008, 1:29:38 PM (14 years ago)
Author:
charles
Message:

fix another crash-on-shutdown in the new web code

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r5700 r5714  
    386386
    387387static void
    388 tr_closeImpl( void * vh )
     388tr_closeAllConnections( void * vh )
    389389{
    390390    tr_handle * h = vh;
    391391    tr_torrent * t;
    392392
    393     tr_webClose( h->web );
    394393    tr_sharedShuttingDown( h->shared );
    395394    tr_trackerShuttingDown( h );
    396 
    397     _tr_blocklistFree( h->blocklist );
    398     h->blocklist = NULL;
    399395
    400396    for( t=h->torrentList; t!=NULL; ) {
     
    429425    tr_statsClose( h );
    430426
    431     tr_runInEventThread( h, tr_closeImpl, h );
     427    tr_runInEventThread( h, tr_closeAllConnections, h );
    432428    while( !h->isClosed && !deadlineReached( deadline ) )
    433429        tr_wait( 100 );
     430
     431    _tr_blocklistFree( h->blocklist );
     432    h->blocklist = NULL;
     433    tr_webClose( &h->web );
    434434
    435435    tr_eventClose( h );
  • trunk/libtransmission/web.c

    r5712 r5714  
    320320
    321321void
    322 tr_webClose( tr_web * web )
     322tr_webClose( tr_web ** web )
    323323{
    324324    dbgmsg( "deleting web->timer" );
    325     evtimer_del( &web->timer );
    326     curl_multi_cleanup( web->cm );
    327     tr_free( web );
     325    evtimer_del( &(*web)->timer );
     326    curl_multi_cleanup( (*web)->cm );
     327    tr_free( *web );
     328    *web = NULL;
    328329}
    329330
  • trunk/libtransmission/web.h

    r5700 r5714  
    1919tr_web* tr_webInit( tr_handle * session );
    2020
    21 void tr_webClose( tr_web * );
     21void tr_webClose( tr_web ** );
    2222
    2323typedef void (tr_web_done_func)( tr_handle    * session,
Note: See TracChangeset for help on using the changeset viewer.