From f53253381c405554a2c3c7b9605403e1fcbe06d0 Mon Sep 17 00:00:00 2001 From: Nestu Date: Sat, 1 Oct 2022 12:27:23 +0200 Subject: [PATCH] Fix BlueMap-Minecraft/BlueMap#346 (#6) --- src/markers/MarkerManager.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/markers/MarkerManager.js b/src/markers/MarkerManager.js index 22748d5..f1b219c 100644 --- a/src/markers/MarkerManager.js +++ b/src/markers/MarkerManager.js @@ -53,6 +53,7 @@ export class MarkerManager { this.fileUrl = fileUrl; this.fileType = fileType; this.events = events; + this.disposed = false; /** @type {NodeJS.Timeout} */ this._updateInterval = null; @@ -67,6 +68,7 @@ export class MarkerManager { if (this._updateInterval) clearTimeout(this._updateInterval); if (ms > 0) { let autoUpdate = () => { + if (this.disposed) return; this.update() .then(success => { if (success) { @@ -153,6 +155,7 @@ export class MarkerManager { * Stops automatic-updates and disposes all markersets and markers managed by this manager */ dispose() { + this.disposed = true; this.setAutoUpdateInterval(0); this.clear(); }