MrTJP / MrTJPCore

Common libraries accross all mods
http://projectredwiki.com/
GNU Lesser General Public License v3.0
13 stars 18 forks source link

EntityPlayer leak caused by KeyTracking map #32

Open mjdg opened 5 years ago

mjdg commented 5 years ago

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.

MrTJP commented 5 years ago

Thanks for pointing this out. Will fix...