Skip to content

Commit

Permalink
Force parent ListenerListInsts to rebuild.
Browse files Browse the repository at this point in the history
Without this change, it is possible (and, in fact, nearly guaranteed) for lists to rebuild endlessly if a parent list is marked as needing a rebuild but never actually read. This change forces the parent list(s) to rebuild as well, resulting in a significant performance increase and smoother framerate due to greatly reduced GC activity.
  • Loading branch information
Uristqwerty committed Dec 25, 2012
1 parent 81f0de8 commit 09ab39a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/net/minecraftforge/event/ListenerList.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ protected boolean shouldRebuild()
*/
private void buildCache()
{
if(parent != null && parent.shouldRebuild())
{
parent.buildCache();
}

ArrayList<IEventListener> ret = new ArrayList<IEventListener>();
for (EventPriority value : EventPriority.values())
{
Expand Down

0 comments on commit 09ab39a

Please sign in to comment.