NiftyCarts

NiftyCarts

613k Downloads

Memory Leak: `NiftyCarts` static reference to `MinecraftServer`

JoshieGemFinder opened this issue ยท 0 comments

commented

Describe the bug
The NiftyCarts class contains a static reference to MinecraftServer in the form of public static MinecraftServer server

This field is not set to null when the singleplayer integrated server is closed, causing the now-closed server to leak.

To fix this memory leak, either:

  • bind to ServerLifecycleEvents.SERVER_STOPPED and set server to null
  • replace the server field with a WeakReference

To Reproduce
N/A

Expected behavior
N/A

Screenshots
N/A

Additional Information:

  • Version: NiftyCarts 21.0.1