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

(trunk gtk) fix crash when leaving the properties dialog open during shutdown

This commit is contained in:
Charles Kerr 2009-06-15 00:01:38 +00:00
parent deb679dab0
commit 2e23c8fade

View file

@ -115,14 +115,20 @@ getTorrents( struct DetailsImpl * d, int * setmeCount )
int n = g_slist_length( d->ids );
int torrentCount = 0;
tr_session * session = tr_core_session( d->core );
tr_torrent ** torrents = g_new( tr_torrent*, n );
GSList * l;
tr_torrent ** torrents = NULL;
for( l=d->ids; l!=NULL; l=l->next ) {
const int id = GPOINTER_TO_INT( l->data );
tr_torrent * tor = tr_torrentFindFromId( session, id );
if( tor )
torrents[torrentCount++] = tor;
if( session != NULL )
{
GSList * l;
torrents = g_new( tr_torrent*, n );
for( l=d->ids; l!=NULL; l=l->next ) {
const int id = GPOINTER_TO_INT( l->data );
tr_torrent * tor = tr_torrentFindFromId( session, id );
if( tor )
torrents[torrentCount++] = tor;
}
}
*setmeCount = torrentCount;