diff --git a/src/cron.js b/src/cron.js index 001d1f4da..bea154d3a 100644 --- a/src/cron.js +++ b/src/cron.js @@ -146,6 +146,8 @@ function autoupdatePatternChanged(pattern) { function uninitialize(callback) { assert.strictEqual(typeof callback, 'function'); + cloudron.events.removeListener(cloudron.EVENT_ACTIVATED, recreateJobs); + if (gAutoupdaterJob) gAutoupdaterJob.stop(); gAutoupdaterJob = null; diff --git a/src/mailer.js b/src/mailer.js index dec43eb82..9b772a656 100644 --- a/src/mailer.js +++ b/src/mailer.js @@ -60,6 +60,8 @@ function initialize(callback) { function uninitialize(callback) { assert.strictEqual(typeof callback, 'function'); + cloudron.events.removeListener(cloudron.EVENT_ACTIVATED, checkDns); + // TODO: interrupt processQueue as well clearTimeout(gCheckDnsTimerId); gCheckDnsTimerId = null;