Changeset 1190


Ignore:
Timestamp:
Dec 11, 2006, 11:12:09 PM (15 years ago)
Author:
joshe
Message:

Avoid doing some potentially bogus things when stopping and deleting a torrent.

Location:
trunk/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr_backend.c

    r760 r1190  
    276276tr_backend_torrents_stopped(TrBackend *back) {
    277277  GList *ii, *list;
     278  tr_stat_t *st;
    278279  gboolean ret = TRUE;
    279280
     
    281282
    282283  list = g_list_copy(back->torrents);
    283   for(ii = list; NULL != ii; ii = ii->next)
    284     if(!(TR_STATUS_PAUSE & tr_torrent_stat_polite(ii->data)->status))
     284  for(ii = list; NULL != ii; ii = ii->next) {
     285    st = tr_torrent_stat_polite(ii->data);
     286    if(NULL == st || !(TR_STATUS_PAUSE & st->status))
    285287      ret = FALSE;
     288  }
    286289  g_list_free(list);
    287290
  • trunk/gtk/tr_torrent.c

    r760 r1190  
    451451tr_torrent_stat_polite(TrTorrent *tor) {
    452452  TrTorrentClass *klass;
    453   tr_stat_t *st = tr_torrentStat(tor->handle);
    454 
    455   if(tor->disposed)
    456     return st;
    457 
     453  tr_stat_t *st;
     454
     455  if(tor->disposed)
     456    return NULL;
     457
     458  st = tr_torrentStat(tor->handle);
    458459  if(tor->closing && TR_STATUS_PAUSE & st->status) {
    459460    tor->closing = FALSE;
    460461    klass = g_type_class_peek(TR_TORRENT_TYPE);
    461462    g_signal_emit(tor, klass->paused_signal_id, 0, NULL);
     463    return tr_torrent_stat_polite(tor);
    462464  }
    463465
Note: See TracChangeset for help on using the changeset viewer.