What
Removing a Dashboard tile (the remove-tile command / a grid-membership change) never invokes the tile's renderer cleanup: src/ui/dashboard.ts simply drops the tileEls entry without calling destroyChart(tileEl), so the panel arm's destroy slot (Chart.js instance teardown — and, since #307, an image tile's revokeObjectUrl) is skipped for the removed tile.
Found during #307's review (src/ui/dashboard.ts, tile reconcile/removal paths for both flow@1 and grafana-grid@1; destroyChart is only called on repaint/state transitions of tiles that still exist).
Why deferred
Pre-existing behavior that affects chart instances too, not something #307 introduced — the image panel deliberately follows the same established destroy-slot convention rather than inventing new tile-lifecycle infrastructure inside a feature PR. Impact is a bounded leak (one Chart.js instance / one blob URL per removed tile, page-lifetime), only reachable through edit-mode tile removal.
Fix sketch
On tile removal in the reconcile paths, call destroyChart(tileEl) (which already funnels both chart and image cleanup) before dropping the tileEls entry, in both layout engines.
What
Removing a Dashboard tile (the
remove-tilecommand / a grid-membership change) never invokes the tile's renderer cleanup:src/ui/dashboard.tssimply drops thetileElsentry without callingdestroyChart(tileEl), so the panel arm'sdestroyslot (Chart.js instance teardown — and, since #307, an image tile'srevokeObjectUrl) is skipped for the removed tile.Found during #307's review (
src/ui/dashboard.ts, tile reconcile/removal paths for bothflow@1andgrafana-grid@1;destroyChartis only called on repaint/state transitions of tiles that still exist).Why deferred
Pre-existing behavior that affects chart instances too, not something #307 introduced — the image panel deliberately follows the same established
destroy-slot convention rather than inventing new tile-lifecycle infrastructure inside a feature PR. Impact is a bounded leak (one Chart.js instance / one blob URL per removed tile, page-lifetime), only reachable through edit-mode tile removal.Fix sketch
On tile removal in the reconcile paths, call
destroyChart(tileEl)(which already funnels both chart and image cleanup) before dropping thetileElsentry, in both layout engines.