From 39f9204fa78e54f1e6aae01bc14693c02514f8f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Tue, 1 Feb 2022 02:58:55 +0100 Subject: [PATCH] Destroy labels that are no longer used --- src/ruler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ruler.js b/src/ruler.js index da115cb..139fb7b 100644 --- a/src/ruler.js +++ b/src/ruler.js @@ -116,7 +116,7 @@ export function extendRuler() { } dragRulerRemovePathfindingWaypoints() { - this.waypoints.filter(waypoint => waypoint.isPathfinding).forEach(_ => this.labels.removeChild(this.labels.children.pop())); + this.waypoints.filter(waypoint => waypoint.isPathfinding).forEach(_ => this.labels.removeChild(this.labels.children[this.labels.children.length - 1]).destroy()); this.waypoints = this.waypoints.filter(waypoint => !waypoint.isPathfinding); }