mirror of
https://github.com/transmission/transmission
synced 2024-12-24 16:52:39 +00:00
(trunk gtk) fix crash when leaving the properties dialog open during shutdown
This commit is contained in:
parent
deb679dab0
commit
2e23c8fade
1 changed files with 13 additions and 7 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue