Changeset 8694


Ignore:
Timestamp:
Jun 15, 2009, 12:01:38 AM (13 years ago)
Author:
charles
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r8666 r8694  
    116116    int torrentCount = 0;
    117117    tr_session * session = tr_core_session( d->core );
    118     tr_torrent ** torrents = g_new( tr_torrent*, n );
    119     GSList * l;
    120 
    121     for( l=d->ids; l!=NULL; l=l->next ) {
    122         const int id = GPOINTER_TO_INT( l->data );
    123         tr_torrent * tor = tr_torrentFindFromId( session, id );
    124         if( tor )
    125             torrents[torrentCount++] = tor;
     118    tr_torrent ** torrents = NULL;
     119
     120    if( session != NULL )
     121    {
     122        GSList * l;
     123
     124        torrents = g_new( tr_torrent*, n );
     125
     126        for( l=d->ids; l!=NULL; l=l->next ) {
     127            const int id = GPOINTER_TO_INT( l->data );
     128            tr_torrent * tor = tr_torrentFindFromId( session, id );
     129            if( tor )
     130                torrents[torrentCount++] = tor;
     131        }
    126132    }
    127133
Note: See TracChangeset for help on using the changeset viewer.