Changeset cdca30b for protocols


Ignore:
Timestamp:
2006-05-27T15:33:58Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4ff0966
Parents:
68b518d6
Message:

Making sure that event handlers don't get called anymore after a call to
b_main_quit().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/events_libevent.c

    r68b518d6 rcdca30b  
    3939static guint id_next;
    4040static GHashTable *id_hash;
     41static int quitting = 0;
    4142
    4243/* Since libevent doesn't handle two event handlers for one fd-condition
     
    7576        struct timeval tv;
    7677       
     78        /* libevent sometimes generates events before really quitting,
     79           we want to stop them. */
     80        quitting = 1;
     81       
    7782        memset( &tv, 0, sizeof( struct timeval ) );
    7883        event_loopexit( &tv );
     
    98103           (which free()s b_ev, we have to remember the ID here. */
    99104        id = b_ev->id;
     105       
     106        if( quitting )
     107        {
     108                b_event_remove( id );
     109                return;
     110        }
    100111       
    101112        if( !b_ev->function( b_ev->data, fd, cond ) )
Note: See TracChangeset for help on using the changeset viewer.