mirror of
https://github.com/BlueMap-Minecraft/BlueMapWeb.git
synced 2025-02-25 22:31:20 +01:00
Fix BlueMap-Minecraft/BlueMap#346 (#6)
This commit is contained in:
parent
a3de6f9122
commit
f53253381c
@ -53,6 +53,7 @@ export class MarkerManager {
|
|||||||
this.fileUrl = fileUrl;
|
this.fileUrl = fileUrl;
|
||||||
this.fileType = fileType;
|
this.fileType = fileType;
|
||||||
this.events = events;
|
this.events = events;
|
||||||
|
this.disposed = false;
|
||||||
|
|
||||||
/** @type {NodeJS.Timeout} */
|
/** @type {NodeJS.Timeout} */
|
||||||
this._updateInterval = null;
|
this._updateInterval = null;
|
||||||
@ -67,6 +68,7 @@ export class MarkerManager {
|
|||||||
if (this._updateInterval) clearTimeout(this._updateInterval);
|
if (this._updateInterval) clearTimeout(this._updateInterval);
|
||||||
if (ms > 0) {
|
if (ms > 0) {
|
||||||
let autoUpdate = () => {
|
let autoUpdate = () => {
|
||||||
|
if (this.disposed) return;
|
||||||
this.update()
|
this.update()
|
||||||
.then(success => {
|
.then(success => {
|
||||||
if (success) {
|
if (success) {
|
||||||
@ -153,6 +155,7 @@ export class MarkerManager {
|
|||||||
* Stops automatic-updates and disposes all markersets and markers managed by this manager
|
* Stops automatic-updates and disposes all markersets and markers managed by this manager
|
||||||
*/
|
*/
|
||||||
dispose() {
|
dispose() {
|
||||||
|
this.disposed = true;
|
||||||
this.setAutoUpdateInterval(0);
|
this.setAutoUpdateInterval(0);
|
||||||
this.clear();
|
this.clear();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user