Ignore:
Timestamp:
Oct 22, 2009, 2:42:24 AM (13 years ago)
Author:
charles
Message:

(1.7x) backports for 1.76: r9261 #2298 Qt client crashes when expired torrent is removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.7x/qt/mainwin.cc

    r8890 r9363  
    701701                                      .arg( Utils :: sizeToString( stats.uploadedBytes ) );
    702702    }
    703     else /* default is "total-ratio" */
     703    else // default is "total-ratio"
    704704    {
    705705        str = tr( "Ratio: %1" ).arg( Utils :: ratioToString( mySession.getCumulativeStats().ratio ) );
     
    720720    const int rowCount( model->rowCount( ) );
    721721
    722     /* count how many torrents are selected, paused, etc */
     722    // count how many torrents are selected, paused, etc
    723723    for( int row=0; row<rowCount; ++row ) {
    724724        const QModelIndex modelIndex( model->index( row, 0 ) );
    725725        assert( model == modelIndex.model( ) );
    726726        const Torrent * tor( model->data( modelIndex, TorrentModel::TorrentRole ).value<const Torrent*>( ) );
    727         const bool isSelected( selectionModel->isSelected( modelIndex ) );
    728         const bool isPaused( tor->isPaused( ) );
    729         if( isSelected )
    730             ++selected;
    731         if( isPaused )
    732             ++ paused;
    733         if( isSelected && isPaused )
    734             ++selectedAndPaused;
    735         if( tor->canManualAnnounce( ) )
    736             ++canAnnounce;
     727        if( tor ) {
     728            const bool isSelected( selectionModel->isSelected( modelIndex ) );
     729            const bool isPaused( tor->isPaused( ) );
     730            if( isSelected )
     731                ++selected;
     732            if( isPaused )
     733                ++ paused;
     734            if( isSelected && isPaused )
     735                ++selectedAndPaused;
     736            if( tor->canManualAnnounce( ) )
     737                ++canAnnounce;
     738        }
    737739    }
    738740
Note: See TracChangeset for help on using the changeset viewer.