Spaces:
Running
Running
Rebuild bundles: safe Pixi teardown across all co-mounted sandbox viewers
Browse filesPicks up auto-battler's teardown fix for scene/tile/sprite/sandbox viewers, so
no map-sandbox pill switch or tab change crashes the co-mounted Game renderer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- web/classesSandbox.js +3 -3
- web/enemiesSandbox.js +3 -3
- web/mapSandbox.js +2 -2
- web/playground.js +2 -2
- web/scene.js +2 -2
web/classesSandbox.js
CHANGED
|
@@ -2640,7 +2640,7 @@ function mountSandboxStage(pixi, stageEl, ctx) {
|
|
| 2640 |
const killApp = () => {
|
| 2641 |
if (currentApp) {
|
| 2642 |
try {
|
| 2643 |
-
currentApp.destroy(
|
| 2644 |
} catch {
|
| 2645 |
}
|
| 2646 |
currentApp = null;
|
|
@@ -2656,7 +2656,7 @@ function mountSandboxStage(pixi, stageEl, ctx) {
|
|
| 2656 |
const app = new Application();
|
| 2657 |
app.init({ background: 15524556, antialias: false, resizeTo: stageEl }).then(async () => {
|
| 2658 |
if (myToken !== token) {
|
| 2659 |
-
app.destroy(
|
| 2660 |
return;
|
| 2661 |
}
|
| 2662 |
stageEl.appendChild(app.canvas);
|
|
@@ -2689,7 +2689,7 @@ function mountSandboxStage(pixi, stageEl, ctx) {
|
|
| 2689 |
}
|
| 2690 |
const R = await createCombatRenderer({ pixi, defsById, layers: { units, fx: fxLayer, projLayer }, coords: { mapX, mapY, depthOf }, getBattle: () => battle });
|
| 2691 |
if (myToken !== token) {
|
| 2692 |
-
app.destroy(
|
| 2693 |
return;
|
| 2694 |
}
|
| 2695 |
const outlines = ["E0", "E1", "E2"].map(() => {
|
|
|
|
| 2640 |
const killApp = () => {
|
| 2641 |
if (currentApp) {
|
| 2642 |
try {
|
| 2643 |
+
currentApp.destroy({ removeView: true });
|
| 2644 |
} catch {
|
| 2645 |
}
|
| 2646 |
currentApp = null;
|
|
|
|
| 2656 |
const app = new Application();
|
| 2657 |
app.init({ background: 15524556, antialias: false, resizeTo: stageEl }).then(async () => {
|
| 2658 |
if (myToken !== token) {
|
| 2659 |
+
app.destroy({ removeView: true });
|
| 2660 |
return;
|
| 2661 |
}
|
| 2662 |
stageEl.appendChild(app.canvas);
|
|
|
|
| 2689 |
}
|
| 2690 |
const R = await createCombatRenderer({ pixi, defsById, layers: { units, fx: fxLayer, projLayer }, coords: { mapX, mapY, depthOf }, getBattle: () => battle });
|
| 2691 |
if (myToken !== token) {
|
| 2692 |
+
app.destroy({ removeView: true });
|
| 2693 |
return;
|
| 2694 |
}
|
| 2695 |
const outlines = ["E0", "E1", "E2"].map(() => {
|
web/enemiesSandbox.js
CHANGED
|
@@ -2603,7 +2603,7 @@ function mountSandboxStage(pixi, stageEl, ctx) {
|
|
| 2603 |
const killApp = () => {
|
| 2604 |
if (currentApp) {
|
| 2605 |
try {
|
| 2606 |
-
currentApp.destroy(
|
| 2607 |
} catch {
|
| 2608 |
}
|
| 2609 |
currentApp = null;
|
|
@@ -2619,7 +2619,7 @@ function mountSandboxStage(pixi, stageEl, ctx) {
|
|
| 2619 |
const app = new Application();
|
| 2620 |
app.init({ background: 15524556, antialias: false, resizeTo: stageEl }).then(async () => {
|
| 2621 |
if (myToken !== token) {
|
| 2622 |
-
app.destroy(
|
| 2623 |
return;
|
| 2624 |
}
|
| 2625 |
stageEl.appendChild(app.canvas);
|
|
@@ -2652,7 +2652,7 @@ function mountSandboxStage(pixi, stageEl, ctx) {
|
|
| 2652 |
}
|
| 2653 |
const R = await createCombatRenderer({ pixi, defsById, layers: { units, fx: fxLayer, projLayer }, coords: { mapX, mapY, depthOf }, getBattle: () => battle });
|
| 2654 |
if (myToken !== token) {
|
| 2655 |
-
app.destroy(
|
| 2656 |
return;
|
| 2657 |
}
|
| 2658 |
const outlines = ["E0", "E1", "E2"].map(() => {
|
|
|
|
| 2603 |
const killApp = () => {
|
| 2604 |
if (currentApp) {
|
| 2605 |
try {
|
| 2606 |
+
currentApp.destroy({ removeView: true });
|
| 2607 |
} catch {
|
| 2608 |
}
|
| 2609 |
currentApp = null;
|
|
|
|
| 2619 |
const app = new Application();
|
| 2620 |
app.init({ background: 15524556, antialias: false, resizeTo: stageEl }).then(async () => {
|
| 2621 |
if (myToken !== token) {
|
| 2622 |
+
app.destroy({ removeView: true });
|
| 2623 |
return;
|
| 2624 |
}
|
| 2625 |
stageEl.appendChild(app.canvas);
|
|
|
|
| 2652 |
}
|
| 2653 |
const R = await createCombatRenderer({ pixi, defsById, layers: { units, fx: fxLayer, projLayer }, coords: { mapX, mapY, depthOf }, getBattle: () => battle });
|
| 2654 |
if (myToken !== token) {
|
| 2655 |
+
app.destroy({ removeView: true });
|
| 2656 |
return;
|
| 2657 |
}
|
| 2658 |
const outlines = ["E0", "E1", "E2"].map(() => {
|
web/mapSandbox.js
CHANGED
|
@@ -3396,7 +3396,7 @@ function createSceneViewer(pixi, host, { layers, dir, sceneW, sceneH, background
|
|
| 3396 |
} catch {
|
| 3397 |
}
|
| 3398 |
try {
|
| 3399 |
-
app?.destroy(
|
| 3400 |
} catch {
|
| 3401 |
}
|
| 3402 |
app = null;
|
|
@@ -3706,7 +3706,7 @@ function createTileViewer(pixi, host, cfg) {
|
|
| 3706 |
} catch {
|
| 3707 |
}
|
| 3708 |
try {
|
| 3709 |
-
app?.destroy(
|
| 3710 |
} catch {
|
| 3711 |
}
|
| 3712 |
app = null;
|
|
|
|
| 3396 |
} catch {
|
| 3397 |
}
|
| 3398 |
try {
|
| 3399 |
+
app?.destroy();
|
| 3400 |
} catch {
|
| 3401 |
}
|
| 3402 |
app = null;
|
|
|
|
| 3706 |
} catch {
|
| 3707 |
}
|
| 3708 |
try {
|
| 3709 |
+
app?.destroy();
|
| 3710 |
} catch {
|
| 3711 |
}
|
| 3712 |
app = null;
|
web/playground.js
CHANGED
|
@@ -77,7 +77,7 @@ function createSpriteScene(pixi, host, opts = {}) {
|
|
| 77 |
const a = new Application();
|
| 78 |
await a.init({ background: 15524556, antialias: false, resizeTo: host });
|
| 79 |
if (destroyed) {
|
| 80 |
-
a.destroy(
|
| 81 |
return;
|
| 82 |
}
|
| 83 |
app = a;
|
|
@@ -452,7 +452,7 @@ function createSpriteScene(pixi, host, opts = {}) {
|
|
| 452 |
if (a) {
|
| 453 |
a.canvas.removeEventListener("pointerdown", onPointerDown);
|
| 454 |
a.canvas.removeEventListener("click", onPointerDown);
|
| 455 |
-
a.destroy(
|
| 456 |
}
|
| 457 |
sprite = shadow = overlay = frames = marker = null;
|
| 458 |
flying = [];
|
|
|
|
| 77 |
const a = new Application();
|
| 78 |
await a.init({ background: 15524556, antialias: false, resizeTo: host });
|
| 79 |
if (destroyed) {
|
| 80 |
+
a.destroy();
|
| 81 |
return;
|
| 82 |
}
|
| 83 |
app = a;
|
|
|
|
| 452 |
if (a) {
|
| 453 |
a.canvas.removeEventListener("pointerdown", onPointerDown);
|
| 454 |
a.canvas.removeEventListener("click", onPointerDown);
|
| 455 |
+
a.destroy({ removeView: true });
|
| 456 |
}
|
| 457 |
sprite = shadow = overlay = frames = marker = null;
|
| 458 |
flying = [];
|
web/scene.js
CHANGED
|
@@ -77,7 +77,7 @@ function createSpriteScene(pixi, host, opts = {}) {
|
|
| 77 |
const a = new Application();
|
| 78 |
await a.init({ background: 15524556, antialias: false, resizeTo: host });
|
| 79 |
if (destroyed) {
|
| 80 |
-
a.destroy(
|
| 81 |
return;
|
| 82 |
}
|
| 83 |
app = a;
|
|
@@ -452,7 +452,7 @@ function createSpriteScene(pixi, host, opts = {}) {
|
|
| 452 |
if (a) {
|
| 453 |
a.canvas.removeEventListener("pointerdown", onPointerDown);
|
| 454 |
a.canvas.removeEventListener("click", onPointerDown);
|
| 455 |
-
a.destroy(
|
| 456 |
}
|
| 457 |
sprite = shadow = overlay = frames = marker = null;
|
| 458 |
flying = [];
|
|
|
|
| 77 |
const a = new Application();
|
| 78 |
await a.init({ background: 15524556, antialias: false, resizeTo: host });
|
| 79 |
if (destroyed) {
|
| 80 |
+
a.destroy();
|
| 81 |
return;
|
| 82 |
}
|
| 83 |
app = a;
|
|
|
|
| 452 |
if (a) {
|
| 453 |
a.canvas.removeEventListener("pointerdown", onPointerDown);
|
| 454 |
a.canvas.removeEventListener("click", onPointerDown);
|
| 455 |
+
a.destroy({ removeView: true });
|
| 456 |
}
|
| 457 |
sprite = shadow = overlay = frames = marker = null;
|
| 458 |
flying = [];
|