Skip to content

Lobby Game End Cleanup (WIP)#2320

Draft
CDMayberry wants to merge 2 commits intomainfrom
fixes/memory-leak-lobby
Draft

Lobby Game End Cleanup (WIP)#2320
CDMayberry wants to merge 2 commits intomainfrom
fixes/memory-leak-lobby

Conversation

@CDMayberry
Copy link
Copy Markdown
Collaborator

Did some investigation into possible memory leaks. Two things that came up were:

  1. a possible failure to cleanup Game from the Lobby.
  2. No cleanup process when a Game is ended.

This adds some fixes to Lobby as well as some new cleanup code to ensure data like the snapshots and the main allGameObjects list are cleared. I'm not positive this is the culprit of the memory leak but cleaning up the snapshots and explicitly clearing a bunch of the data is probably still a good call.

Changes

Added explicit teardown via Game.destroy(), SnapshotManager.destroy(), and GameStateManager.destroy(), wired listener-owning subsystems into cleanup (OngoingEffectEngine, GameStatisticsLogger), and updated Lobby so only active unfinished games count as ongoing. Permanently finished Bo1 / completed Bo3 games are now destroyed and released; the short between-games Bo3 case is still retained until transition. I also fixed removeUser() so it doesn’t try to send game state after cleanup.

Added tests in test\server\core\GameStateManagerDestroy.spec.ts and test\server\gamenode\Lobby.spec.ts.

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