1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

(web) #3296: Deleting a torrent hidden in the webui corrupts the row model

This commit is contained in:
Daniel Lee 2010-06-16 03:04:40 +00:00
parent 7f8db1f3c2
commit 59821c65c7

View file

@ -1566,6 +1566,9 @@ Transmission.prototype =
var e = torrent.element();
if( e ) {
var row_index = tr.getTorrentIndex(tr._rows, torrent);
//if torrent is not currently visible then delete a hidden row
//otherwise the row model gets corrupted because no row gets deleted
if( row_index == null ) row_index = tr._rows.length - 1;
delete e._torrent; //remove circular refernce to help IE garbage collect
tr._rows.splice(row_index, 1)
e.remove();