Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear worlds and player cache when logical server stops #215

Merged
merged 6 commits into from
Aug 6, 2023

Conversation

KevinDaGame
Copy link
Owner

@KevinDaGame KevinDaGame commented Aug 5, 2023

What type of PR is this? (check all applicable)

  • Feature
  • Refactor
  • Bug Fix
  • Optimization
  • Documentation Update

Description

The cache was not cleared, meaning that if you rejoined a world, the mod would still take from the cache, and crash the logical server because it's invalid.

Also implemented the unload world listener to prevent memory leak

QA Instructions, Screenshots, Recordings

  1. load a singleplayer world
  2. do snipe actions
  3. leave and load again
  4. do snipe actions
  5. see that it works

Added/updated tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests
  • Not needed

[optional] What gif best describes this PR or how it makes you feel?

alt_text

@KevinDaGame KevinDaGame added bug Something isn't working Forge Forge specific labels Aug 5, 2023
@KevinDaGame KevinDaGame self-assigned this Aug 5, 2023
@KevinDaGame KevinDaGame linked an issue Aug 5, 2023 that may be closed by this pull request
Copy link
Collaborator

@Lennart99 Lennart99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but just a thought, shouldn't we also remove Players when they leave? Doesn't look like we are doing that on Forge (although it does any matter for servers)

@KevinDaGame
Copy link
Owner Author

LGTM, but just a thought, shouldn't we also remove Players when they leave? Doesn't look like we are doing that on Forge (although it does any matter for servers)

Good point. I have implemented it

@KevinDaGame KevinDaGame merged commit c9de9ed into master Aug 6, 2023
1 check passed
@KevinDaGame KevinDaGame deleted the forge/fix/clear_cache_between_game_instances branch August 6, 2023 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Forge Forge specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Memory leak when unloading worlds
2 participants