diff --git a/lib/converter.js b/lib/converter.js index 7178cade..5bb4dcac 100644 --- a/lib/converter.js +++ b/lib/converter.js @@ -656,13 +656,16 @@ function detectLibreOffice (additionalPaths) { detectLibreOffice(); -['SIGINT', 'SIGHUP', 'SIGQUIT'].forEach(function (signal) { - process.on(signal, function () { - converter.exit(); - }); +['SIGINT', 'SIGHUP', 'SIGQUIT'].forEach((signal) => { + const cleanup = () => { + converter.exit(() => { + process.removeListener(signal, cleanup); + process.kill(process.pid, signal); + }); + } + process.on(signal, cleanup); }); - process.on('exit', function () { converter.exit(); });