Replace calls to sync.cleanup with sync.removealllisteners (#1066)
This commit is contained in:
parent
523c1ec772
commit
af72770094
|
@ -78,15 +78,14 @@ module.exports = function(realmConstructor) {
|
||||||
|
|
||||||
realmConstructor.Sync.AuthError = require('./errors').AuthError;
|
realmConstructor.Sync.AuthError = require('./errors').AuthError;
|
||||||
|
|
||||||
if (realmConstructor.Sync.cleanup) {
|
if (realmConstructor.Sync.removeAllListeners) {
|
||||||
// FIXME: DOES THIS WORK ON BOTH NODE AND REACT NATIVE?
|
process.on('exit', realmConstructor.Sync.removeAllListeners);
|
||||||
process.on('exit', realmConstructor.Sync.cleanup);
|
|
||||||
process.on('SIGINT', function () {
|
process.on('SIGINT', function () {
|
||||||
realmConstructor.Sync.cleanup();
|
realmConstructor.Sync.removeAllListeners();
|
||||||
process.exit(2);
|
process.exit(2);
|
||||||
});
|
});
|
||||||
process.on('uncaughtException', function(e) {
|
process.on('uncaughtException', function(e) {
|
||||||
realmConstructor.Sync.cleanup();
|
realmConstructor.Sync.removeAllListeners();
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
console.log(e.stack);
|
console.log(e.stack);
|
||||||
process.exit(99);
|
process.exit(99);
|
||||||
|
|
Loading…
Reference in New Issue