Changeset 5880


Ignore:
Timestamp:
May 21, 2008, 5:14:58 PM (14 years ago)
Author:
charles
Message:

rename tr_torrentClose() as tr_torrentFree() and make it private. change client code to use tr_torrentRemove() instead. This fixes the confusion between the two methods that led to #954

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/beos/TRWindow.cpp

    r5843 r5880  
    120120}
    121121
    122 static void torrentclose(tr_torrent_t *torrent, void *)
    123 {
    124         tr_torrentClose(torrent);
    125 }
    126 
    127122TRWindow::~TRWindow() {
    128         tr_torrentIterate(engine, torrentclose, NULL);
    129123        const int MAX_EXIT_WAIT_SECS = 10;
    130124        const time_t deadline = time(0) + MAX_EXIT_WAIT_SECS;
     
    354348                // Remove the file from the filesystem.
    355349                TRTransfer *item = (TRTransfer*)transfers->RemoveItem(index);
    356                 tr_torrentClose(item->GetTorrent());
     350                tr_torrentRemove(item->GetTorrent());
    357351                BEntry *entry = new BEntry(item->GetCachedPath(), true);
    358352                entry->Remove();
  • trunk/cli/transmissioncli.c

    r5843 r5880  
    374374   
    375375cleanup:
    376     tr_torrentClose( tor );
    377376    tr_sessionClose( h );
    378377
  • trunk/doc/rpc-spec.txt

    r5868 r5880  
    6666   Method name         | libtransmission function
    6767   --------------------+-------------------------------------------------
    68    "torrent-close"     | tr_torrentClose
    6968   "torrent-remove"    | tr_torrentRemove
    7069   "torrent-start"     | tr_torrentStart
  • trunk/gtk/tr-torrent.c

    r5868 r5880  
    8282                tr_torrentRemove( self->priv->handle );
    8383            else
    84                 tr_torrentClose( self->priv->handle );
     84                tr_torrentFree( self->priv->handle );
    8585        }
    8686
  • trunk/libtransmission/rpc.c

    r5868 r5880  
    116116        tr_torrentStop( tor );
    117117        notify( h, TR_RPC_TORRENT_STOPPED, tor );
    118     }
    119     tr_free( torrents );
    120     return NULL;
    121 }
    122 
    123 static const char*
    124 torrentClose( tr_handle * h, tr_benc * args_in, tr_benc * args_out UNUSED )
    125 {
    126     int i, torrentCount;
    127     tr_torrent ** torrents = getTorrents( h, args_in, &torrentCount );
    128     for( i=0; i<torrentCount; ++i )
    129     {
    130         tr_torrent * tor = torrents[i];
    131         notify( h, TR_RPC_TORRENT_CLOSING, tor );
    132         tr_torrentClose( tor );
    133118    }
    134119    tr_free( torrents );
     
    684669    { "session-set", sessionSet },
    685670    { "torrent-add", torrentAdd },
    686     { "torrent-close", torrentClose },
    687671    { "torrent-get-priorities", torrentGetPriorities },
    688672    { "torrent-get", torrentGet },
  • trunk/libtransmission/session.c

    r5855 r5880  
    426426
    427427    while(( tor = tr_torrentNext( h, NULL )))
    428         tr_torrentClose( tor );
     428        tr_torrentFree( tor );
    429429
    430430    tr_peerMgrFree( h->peerMgr );
  • trunk/libtransmission/torrent.c

    r5868 r5880  
    11191119
    11201120void
    1121 tr_torrentClose( tr_torrent * tor )
     1121tr_torrentFree( tr_torrent * tor )
    11221122{
    11231123    if( tor != NULL )
     
    11371137{
    11381138    tor->isDeleting = 1;
    1139     tr_torrentClose( tor );
     1139    tr_torrentFree( tor );
    11401140}
    11411141
  • trunk/libtransmission/transmission.h

    r5868 r5880  
    744744 * Running torrents are stopped first.
    745745 */
    746 void tr_torrentClose( tr_torrent * );
    747 
    748 /**
    749  * Like tr_torrentClose() but also deletes
    750  * the resume file and our copy of the
    751  * torrent file
     746void tr_torrentFree( tr_torrent * );
     747
     748/**
     749 * Removes our .torrent and .resume files for this
     750 * torrent, then calls tr_torrentFree()
    752751 */
    753752void tr_torrentRemove( tr_torrent * );
  • trunk/wx/xmission.cc

    r5843 r5880  
    328328MyFrame :: OnRemove( wxCommandEvent& WXUNUSED(unused) )
    329329{
    330     foreach( torrents_v, mySelectedTorrents, it ) {
    331         tr_torrentRemoveSaved( *it );
    332         tr_torrentClose( *it );
    333     }
     330    foreach( torrents_v, mySelectedTorrents, it )
     331        tr_torrentRemove( *it );
    334332}
    335333
Note: See TracChangeset for help on using the changeset viewer.