1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 17:17:31 +00:00

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

This commit is contained in:
Charles Kerr 2010-02-06 20:25:25 +00:00
parent e305a68d7b
commit 95a4adfd22

View file

@ -1727,15 +1727,28 @@ tr_sessionIsLazyBitfieldEnabled( const tr_session * session )
****
***/
void
tr_sessionSetPortForwardingEnabled( tr_session * session,
tr_bool enabled )
struct port_forwarding_data
{
assert( tr_isSession( session ) );
tr_bool enabled;
struct tr_shared * shared;
};
tr_sessionLock( session );
tr_sharedTraversalEnable( session->shared, enabled );
tr_sessionUnlock( session );
static void
setPortForwardingEnabled( void * vdata )
{
struct port_forwarding_data * data = vdata;
tr_sharedTraversalEnable( data->shared, data->enabled );
tr_free( data );
}
void
tr_sessionSetPortForwardingEnabled( tr_session * session, tr_bool enabled )
{
struct port_forwarding_data * d;
d = tr_new0( struct port_forwarding_data, 1 );
d->shared = session->shared;
d->enabled = enabled;
tr_runInEventThread( session, setPortForwardingEnabled, d );
}
tr_bool