From a503e9dd2fb936cf94ab79546161401db06acc40 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:21:53 +0800 Subject: + maby fix crash for some people --- featureClass/class.js | 9 +++++++-- featureClass/featureManager.js | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'featureClass') diff --git a/featureClass/class.js b/featureClass/class.js index dc0ca27..22614b1 100644 --- a/featureClass/class.js +++ b/featureClass/class.js @@ -211,14 +211,19 @@ class Event { if (this.enabled) return this.enabled = true - this.actuallyRegister() + + delay(0, () => { + this.actuallyRegister() + }) } unregister() { if (!this.enabled) return this.enabled = false - this.actuallyUnregister() + delay(0, () => { + this.actuallyUnregister() + }) } actuallyRegister() { } diff --git a/featureClass/featureManager.js b/featureClass/featureManager.js index 9da76c7..0f0edeb 100644 --- a/featureClass/featureManager.js +++ b/featureClass/featureManager.js @@ -414,6 +414,7 @@ class FeatureManager { // } // }) // }else{ + this.eventObjects[event] = register(event, (...args) => { // let start = Date.now() this.triggerEvent(event, args) -- cgit