Fix a memleak in the pathfinding debug rendering
This commit is contained in:
+2
-2
@@ -156,7 +156,7 @@ function paintGriddedPathfindingDebug(lastNode, token) {
|
|||||||
if (!CONFIG.debug.dragRuler)
|
if (!CONFIG.debug.dragRuler)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
debugGraphics.removeChildren();
|
debugGraphics.removeChildren().forEach(c => c.destroy());
|
||||||
let currentNode = lastNode;
|
let currentNode = lastNode;
|
||||||
while (currentNode) {
|
while (currentNode) {
|
||||||
let text = new PIXI.Text(currentNode.cost.toFixed(0));
|
let text = new PIXI.Text(currentNode.cost.toFixed(0));
|
||||||
@@ -173,7 +173,7 @@ function paintGridlessPathfindingDebug(pathfinder) {
|
|||||||
if (!CONFIG.debug.dragRuler)
|
if (!CONFIG.debug.dragRuler)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
debugGraphics.removeChildren();
|
debugGraphics.removeChildren().forEach(c => c.destroy());
|
||||||
let graphic = new PIXI.Graphics();
|
let graphic = new PIXI.Graphics();
|
||||||
graphic.lineStyle(2, 0x440000);
|
graphic.lineStyle(2, 0x440000);
|
||||||
for (const point of GridlessPathfinding.debugGetPathfindingPoints(pathfinder)) {
|
for (const point of GridlessPathfinding.debugGetPathfindingPoints(pathfinder)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user