mafintosh/torrent-stream — pull request #44 by arestov (2014-05-17 05:21:36+00:00)
Title: Allow to reuse  torrent object (or just external use) even after torrentStream instance destroy

Detaches closure from ``torrent`` object (frome ``files`` prop in ``torrent`` obj).

We cannot use this bellow, because memory leak here, which is caused by closure.
```
var engine = torrentStream('magnet://..');
var memory_cache = {};

engine.on('ready', function() {

memory_cache[engine.torrent.infoHash] = engine.torrent;

/*
...
using of engine
...
*/

engine.destroy();
});
```

Memory will not be released, since ``memory_cache[..].files[0].select`` will have closure connected to ``engine``.

And actually ``select`` method in ``engine.torrent.files[n]`` is side effect. Interaction with ``engine.files[n].select`` must be enough