From af727700947e176c505f42682e6c19ba41c27406 Mon Sep 17 00:00:00 2001 From: Kristian Dupont Date: Wed, 14 Jun 2017 12:54:47 +0200 Subject: [PATCH] Replace calls to sync.cleanup with sync.removealllisteners (#1066) --- lib/extensions.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/extensions.js b/lib/extensions.js index 3bcdb051..76d1918f 100644 --- a/lib/extensions.js +++ b/lib/extensions.js @@ -78,15 +78,14 @@ module.exports = function(realmConstructor) { realmConstructor.Sync.AuthError = require('./errors').AuthError; - if (realmConstructor.Sync.cleanup) { - // FIXME: DOES THIS WORK ON BOTH NODE AND REACT NATIVE? - process.on('exit', realmConstructor.Sync.cleanup); + if (realmConstructor.Sync.removeAllListeners) { + process.on('exit', realmConstructor.Sync.removeAllListeners); process.on('SIGINT', function () { - realmConstructor.Sync.cleanup(); + realmConstructor.Sync.removeAllListeners(); process.exit(2); }); process.on('uncaughtException', function(e) { - realmConstructor.Sync.cleanup(); + realmConstructor.Sync.removeAllListeners(); /* eslint-disable no-console */ console.log(e.stack); process.exit(99);