MrTJPCore

24M Downloads

EntityPlayer leak caused by KeyTracking map

mjdg opened this issue ยท 1 comments

commented

The KeyTracking object uses a Player reference as a map key. Entries are added to the map as needed and never removed. This prevents the collection of the EntityPlayer and things it references (e.g. the WorldClient).

Steps to reproduce problem:

  1. create a new SP world with MrTJPCore + Project Red installed
  2. jump (adds player reference to KeyTracking's map)
  3. quit to main menu
  4. reload the world from step 1.

Examining the heap e.g. with VisualVM shows 2 EntityPlayerSP objects. Repeating steps 2-4 creates another instance.

commented

Thanks for pointing this out. Will fix...