fix(operation) setListeners: leak on copy, pack, delete

This commit is contained in:
coderaiser 2016-10-27 17:59:44 +03:00
parent 704d33d956
commit 8cabdb80ee

View file

@ -85,8 +85,8 @@
copier.on('connect', function() {
authCheck(copier, function() {
setListeners(copier, callback);
copyFn = function(data, callback) {
setListeners(copier, callback);
copier.copy(data.from, data.to, data.names);
};
});
@ -103,10 +103,9 @@
fn();
remover.on('connect', function() {
authCheck(remover, function() {
setListeners(remover, callback);
deleteFn = function(from, files, callback) {
from = from.replace(/\?.*/, '');
setListeners(remover, callback);
remover.remove(from, files);
};
});
@ -123,14 +122,12 @@
fn();
packer.on('connect', function() {
authCheck(packer, function() {
setListeners(packer, callback);
packFn = function(data, callback) {
setListeners(packer, callback);
packer.pack(data.from, data.to, data.names);
};
extractFn = function(data, callback) {
setListeners(packer, callback);
packer.extract(data.from, data.to);
};
});