mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 18:54:45 +00:00
Fix minor memory leaks (#258)
* Fix memory leak caused by mob spawner items
* Use a weak hash map instead of manually clearing the map
* Clear manager reference to prevent holding a WorldClient reference through the GUI
* Revert "Use a weak hash map instead of manually clearing the map"
This reverts commit 91bb997250.
This commit is contained in:
1 parent
d20a80a77c
commit
de2b2ece69
2 files changed
+10
No files matched your search
@@ -96,6 +96,10 @@ public class ItemMobSpawner extends ItemBlock
|
||||
return e;
|
||||
}
|
||||
|
||||
public static void clearEntityReferences(World newWorld) {
|
||||
entityHashMap.values().removeIf(e -> e.worldObj != newWorld);
|
||||
}
|
||||
|
||||
private void setDefaultTag(ItemStack itemstack) {
|
||||
if (!IDtoNameMap.containsKey(itemstack.getItemDamage()))
|
||||
itemstack.setItemDamage(idPig);
|
||||
|
||||
Reference in new issue
Block a user