Changeset 9838


Ignore:
Timestamp:
Dec 29, 2009, 12:00:33 AM (12 years ago)
Author:
charles
Message:

(trunk libT) #2416 "crash in event_queue_insert" -- I am really quite sick of this bug. It's not reproducible at all under Linux and appears to be a bug in libevent's kqueue implementation. In this commit, we leak the event object on OS X.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/web.c

    r9837 r9838  
    1717
    1818#include "transmission.h"
    19 #include "list.h"
    2019#include "net.h"
    2120#include "session.h"
     
    5655    tr_address addr;
    5756    struct event timer_event;
    58     tr_list * active_events;
    59     tr_list * inactive_events;
    6057};
    6158
    6259static void
    63 event_list_node_free( void * event )
    64 {
    65     event_del( event );
    66     tr_free( event );
    67 }
    68 
    69 static void
    7060web_free( tr_web * g )
    7161{
    7262    curl_multi_cleanup( g->multi );
    73     tr_list_free( &g->active_events, event_list_node_free );
    74     tr_list_free( &g->inactive_events, event_list_node_free );
    7563    evtimer_del( &g->timer_event );
    7664    memset( g, TR_MEMORY_TRASH, sizeof( struct tr_web ) );
     
    304292        {
    305293            event_del( io_event );
    306             tr_list_remove_data( &web->active_events, io_event );
    307             tr_list_append( &web->inactive_events, io_event );
     294#ifndef SYS_DARWIN
     295            tr_free( io_event );
     296#else
     297#warning FIXME - OS X
     298#endif
    308299            curl_multi_assign( web->multi, fd, NULL );
    309300            /*fprintf( stderr, "-1 io_events to %d\n", --num_events );*/
     
    319310            event_del( io_event );
    320311        else {
    321             io_event = tr_list_pop_front( &web->inactive_events );
    322             if( io_event == NULL )
    323                 io_event = tr_new0( struct event, 1 );
     312            io_event = tr_new0( struct event, 1 );
    324313            curl_multi_assign( web->multi, fd, io_event );
    325             tr_list_append( &web->active_events, io_event );
    326314            /*fprintf( stderr, "+1 io_events to %d\n", ++num_events );*/
    327315        }
Note: See TracChangeset for help on using the changeset viewer.