1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-02 16:43:28 +00:00

1. Added CycleCount, MinimumDelay, MaximumDelay, support to Self Update Test

2. Fixed edge case resource leak with clipboard on linux
This commit is contained in:
Bryan Roe
2022-06-14 22:03:49 -07:00
parent de8322321c
commit f710290357
3 changed files with 123 additions and 38 deletions

View File

@@ -382,7 +382,7 @@ function lin_xclip_copy(txt)
ret.child.promise = ret;
ret.child.stderr.on('data', function (c) { console.log(c.toString()); });
ret.child.stdout.on('data', function (c) { console.log(c.toString()); });
ret.child._cleanup = function _cleanup(p)
ret.child._helper = function _helper(p)
{
var ch = require('child_process').execFile('/bin/sh', ['sh']);
ch.stdout.str = ''; ch.stdout.on('data', function (c) { this.str += c.toString(); });
@@ -412,8 +412,20 @@ function lin_xclip_copy(txt)
ch.waitExit();
if (ch.stdout.str != '')
{
process.kill(parseInt(ch.stdout.str), 'SIGKILL');
try
{
return (parseInt(ch.stdout.str.trim()));
}
catch (x)
{
return (-1);
}
}
return (-1);
};
ret.child._cleanup = function _cleanup(p)
{
process.kill(this._xclip_PID, 'SIGKILL');
delete xclipTable[p._hashCode()];
};
ret.child.on('exit', function ()
@@ -435,7 +447,7 @@ function lin_xclip_copy(txt)
this._cleanup(this.promise);
}
});
ret.child._xclip_PID = ret.child._helper(ret);
return (ret);
}