OpenBlocks

OpenBlocks

56M Downloads

[SEVERE] References!

nevercast opened this issue ยท 2 comments

commented

Below is a list of classes that hold references to Entities or World Objects that could cause World Leaks.
Note: WeakHashMaps only have weak KEYS, they do not have weak VALUE references.

  • src/openblocks/common/entity/EntityHangGlider.java
    References EntityHangGlider as a value; which is an Entity, Entities have a worldObj

The crane does use references, but as they're used only in the method context, they're on the stack and are removed at the exit of the method.

That's all for now, originally the state looked a lot worse. But with a quick glance over, using only GitHub; this seems to be all.

I will append one more note, the use of getEntitiesInAABB for players can be improved by iterating players and calculating distance with pythag'

commented

nice "list" there ;-)

commented

Yeah :(
My initial GitHub search turned up more issues, but only because there is more than one way to create a weak list :P

Good for you :D