Force parent ListenerListInsts to rebuild.
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.
This commit is contained in:
parent
81f0de81ea
commit
09ab39a238
1 changed files with 5 additions and 0 deletions
|
@ -185,6 +185,11 @@ public class ListenerList
|
|||
*/
|
||||
private void buildCache()
|
||||
{
|
||||
if(parent != null && parent.shouldRebuild())
|
||||
{
|
||||
parent.buildCache();
|
||||
}
|
||||
|
||||
ArrayList<IEventListener> ret = new ArrayList<IEventListener>();
|
||||
for (EventPriority value : EventPriority.values())
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue