Ignore:
Timestamp:
Dec 16, 2010, 3:38:07 AM (11 years ago)
Author:
charles
Message:

(trunk) #3675 "Not all .part files are removed" -- added patch for libtransmission and GTK+ client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r11537 r11538  
    17511751}
    17521752
    1753 void
    1754 tr_torrentRemove( tr_torrent * tor )
    1755 {
    1756     assert( tr_isTorrent( tor ) );
    1757 
     1753struct remove_data
     1754{
     1755    tr_torrent   * tor;
     1756    tr_bool        deleteFlag;
     1757    tr_fileFunc  * deleteFunc;
     1758};
     1759
     1760static void
     1761removeTorrent( void * vdata )
     1762{
     1763    struct remove_data * data = vdata;
     1764
     1765    if( data->deleteFlag )
     1766        tr_torrentDeleteLocalData( data->tor, data->deleteFunc );
     1767
     1768    tr_torrentClearCompletenessCallback( data->tor );
     1769    closeTorrent( data->tor );
     1770    tr_free( data );
     1771}
     1772
     1773void
     1774tr_torrentRemove( tr_torrent   * tor,
     1775                  tr_bool        deleteFlag,
     1776                  tr_fileFunc    deleteFunc )
     1777{
     1778    struct remove_data * data;
     1779
     1780    assert( tr_isTorrent( tor ) );
    17581781    tor->isDeleting = 1;
    1759     tr_torrentFree( tor );
     1782
     1783    data = tr_new0( struct remove_data, 1 );
     1784    data->tor = tor;
     1785    data->deleteFlag = deleteFlag;
     1786    data->deleteFunc = deleteFunc;
     1787    tr_runInEventThread( tor->session, removeTorrent, data );
    17601788}
    17611789
Note: See TracChangeset for help on using the changeset viewer.