Ignore:
Timestamp:
Oct 2, 2007, 4:12:44 PM (15 years ago)
Author:
charles
Message:

clean up the shutdown code a little bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-io.c

    r3269 r3271  
    172172}
    173173
    174 void
    175 tr_peerIoFree( tr_peerIo * c )
    176 {
    177     if( c != NULL )
     174static void
     175io_dtor( void * vio )
     176{
     177    tr_peerIo * io = vio;
     178
     179    bufferevent_free( io->bufev );
     180    tr_netClose( io->socket );
     181    tr_cryptoFree( io->crypto );
     182    tr_free( io );
     183}
     184
     185void
     186tr_peerIoFree( tr_peerIo * io )
     187{
     188    if( io != NULL )
    178189    {
    179         c->canRead = NULL;
    180         c->didWrite = NULL;
    181         c->gotError = NULL;
    182         bufferevent_free( c->bufev );
    183         tr_netClose( c->socket );
    184 
    185         tr_cryptoFree( c->crypto );
    186 
    187         tr_free( c );
     190        io->canRead = NULL;
     191        io->didWrite = NULL;
     192        io->gotError = NULL;
     193        tr_runInEventThread( io->handle, io_dtor, io );
    188194    }
    189195}
Note: See TracChangeset for help on using the changeset viewer.