Changeset 10124


Ignore:
Timestamp:
Feb 6, 2010, 8:25:25 PM (13 years ago)
Author:
charles
Message:

(trunk libT) #2745 "Crash with tr_sessionSetPortForwardingEnabled()" -- fixed in trunk for 1.90

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r10094 r10124  
    17281728***/
    17291729
    1730 void
    1731 tr_sessionSetPortForwardingEnabled( tr_session  * session,
    1732                                     tr_bool       enabled )
    1733 {
    1734     assert( tr_isSession( session ) );
    1735 
    1736     tr_sessionLock( session );
    1737     tr_sharedTraversalEnable( session->shared, enabled );
    1738     tr_sessionUnlock( session );
     1730struct port_forwarding_data
     1731{
     1732    tr_bool enabled;
     1733    struct tr_shared * shared;
     1734};
     1735
     1736static void
     1737setPortForwardingEnabled( void * vdata )
     1738{
     1739    struct port_forwarding_data * data = vdata;
     1740    tr_sharedTraversalEnable( data->shared, data->enabled );
     1741    tr_free( data );
     1742}
     1743
     1744void
     1745tr_sessionSetPortForwardingEnabled( tr_session  * session, tr_bool enabled )
     1746{
     1747    struct port_forwarding_data * d;
     1748    d = tr_new0( struct port_forwarding_data, 1 );
     1749    d->shared = session->shared;
     1750    d->enabled = enabled;
     1751    tr_runInEventThread( session, setPortForwardingEnabled, d );
    17391752}
    17401753
Note: See TracChangeset for help on using the changeset viewer.