It is not when torrents become dead because of no seeders, it is when a administrator DELETES a torrent!
I already have applied the line you gave me before you wrote it here!
UPDATE:
/deltorrent.php
Add this with the other SQL queries.
PHP Code:
sql_query("DELETE FROM peers WHERE torrent IN (" . implode(", ", array_map("sqlesc", $_POST["delete"])) . ")") or sqlerr(__FILE__,__LINE__);
Seems only to happen when you use the DELETE button at the bottom in browse.php