1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 01:57:52 +00:00

fix minor shutdown bug

This commit is contained in:
Charles Kerr 2007-10-08 00:56:12 +00:00
parent 304f9f7f18
commit 43a016cdb9

View file

@ -108,11 +108,16 @@ static void
pumpList( int i UNUSED, short s UNUSED, void * veh ) pumpList( int i UNUSED, short s UNUSED, void * veh )
{ {
tr_event_handle * eh = veh; tr_event_handle * eh = veh;
int doDie;
while( !eh->die ) for( ;; )
{ {
struct tr_event_command * cmd; struct tr_event_command * cmd;
doDie = eh->die && !eh->timerCount;
if( doDie )
break;
/* get the next command */ /* get the next command */
tr_lockLock( eh->lock ); tr_lockLock( eh->lock );
cmd = tr_list_pop_front( &eh->commands ); cmd = tr_list_pop_front( &eh->commands );
@ -161,7 +166,7 @@ pumpList( int i UNUSED, short s UNUSED, void * veh )
tr_free( cmd ); tr_free( cmd );
} }
if( !eh->die ) if( !doDie )
timeout_add( &eh->pulse, &eh->pulseInterval ); timeout_add( &eh->pulse, &eh->pulseInterval );
else { else {
assert( eh->timerCount == 0 ); assert( eh->timerCount == 0 );