Changeset 7806


Ignore:
Timestamp:
Jan 26, 2009, 8:23:11 AM (12 years ago)
Author:
charles
Message:

(trunk libT) another possible fix for the libevent corruption issue -- libevent calls were being invoked from the gui thread at startup via tr_sessionInit()'s call to tr_webInit(). This revision moves those calls into the libtransmission/libevent thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r7803 r7806  
    358358
    359359static void metainfoLookupRescan( tr_session * );
     360static void tr_sessionInitImpl( void * );
    360361
    361362tr_session *
     
    515516    tr_sessionSetSpeedLimit( session, TR_DOWN, i );
    516517    tr_sessionSetSpeedLimitEnabled( session, TR_DOWN, j );
    517  
    518     /* first %s is the application name
    519        second %s is the version number */
    520     tr_inf( _( "%s %s started" ), TR_NAME, LONG_VERSION_STRING );
    521518
    522519    /* initialize the blocklist */
     
    529526    loadBlocklists( session );
    530527
     528    session->rpcServer = tr_rpcInit( session, &settings );
     529
     530    tr_bencFree( &settings );
     531
     532    tr_runInEventThread( session, tr_sessionInitImpl, session );
     533    return session;
     534}
     535static void
     536tr_sessionInitImpl( void * vsession )
     537{
     538    tr_session * session = vsession;
     539 
     540    /* first %s is the application name
     541       second %s is the version number */
     542    tr_inf( _( "%s %s started" ), TR_NAME, LONG_VERSION_STRING );
     543
    531544    tr_statsInit( session );
    532545
    533546    session->web = tr_webInit( session );
    534     session->rpcServer = tr_rpcInit( session, &settings );
    535547
    536548    metainfoLookupRescan( session );
    537 
    538     tr_bencFree( &settings );
    539     return session;
    540549}
    541550
Note: See TracChangeset for help on using the changeset viewer.