From 466e5a36d1ff304c90653d07436e8e5759615fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Tue, 15 Feb 2022 09:40:54 +0100 Subject: [PATCH] Fix a memleak in the pathfinding debug rendering --- js/pathfinding.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/pathfinding.js b/js/pathfinding.js index fba9e6e..b7100ec 100644 --- a/js/pathfinding.js +++ b/js/pathfinding.js @@ -156,7 +156,7 @@ function paintGriddedPathfindingDebug(lastNode, token) { if (!CONFIG.debug.dragRuler) return; - debugGraphics.removeChildren(); + debugGraphics.removeChildren().forEach(c => c.destroy()); let currentNode = lastNode; while (currentNode) { let text = new PIXI.Text(currentNode.cost.toFixed(0)); @@ -173,7 +173,7 @@ function paintGridlessPathfindingDebug(pathfinder) { if (!CONFIG.debug.dragRuler) return; - debugGraphics.removeChildren(); + debugGraphics.removeChildren().forEach(c => c.destroy()); let graphic = new PIXI.Graphics(); graphic.lineStyle(2, 0x440000); for (const point of GridlessPathfinding.debugGetPathfindingPoints(pathfinder)) {