Skip to content

fix: prevent ClassCastException in /preload caused by leaked tutorial holograms - #266

Open
LordTuxn wants to merge 3 commits into
mainfrom
fix/tutorial-hologram-leak
Open

LordTuxn wants to merge 3 commits into
mainfrom
fix/tutorial-hologram-leak

Conversation

@LordTuxn

Copy link
Copy Markdown
Member

Fixes a ClassCastException in /preload.

  • Tutorial holograms that were never shown were not cleaned up when a stage ended or the tutorial stopped. They stayed in DecentHologramDisplay.activeDisplays and leaked memory.
  • /preload and /setleaderboard cast every entry of that list to HologramConfiguration. Leaderboards are now tracked in HologramRegister.
  • On shutdown, every second active tutorial was skipped.

/preload and /setleaderboard iterated DecentHologramDisplay.activeDisplays and cast every entry to HologramConfiguration. That list also contains tutorial and NPC holograms, which caused a ClassCastException on /preload.
Tutorial holograms register themselves when the stages are constructed, but some are only shown later in the timeline. Cleanup selected holograms by visibility, so holograms that were not yet shown when a stage ended or the tutorial was stopped stayed until the next restart.

The leftovers were caused by ClassCastException on `/preload` (c747e33)
onTutorialStop removes the tutorial from the active list, so the indexed loop in onDisable skipped every second tutorial and left its holograms and NPC behind.
@LordTuxn
LordTuxn requested a review from Zoriot November 13, 2026 22:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant