From 0e8cd28f916d10f3d588114eebc903902675f063 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 4 Jul 2013 23:04:20 +0200 Subject: NEWT WindowImpl: Add little GCed / windowList-size stats at addWindow2List --- src/newt/classes/jogamp/newt/WindowImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/newt') diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index d24c6ed36..2c3c903f1 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -109,15 +109,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer private static void addWindow2List(WindowImpl window) { synchronized(windowList) { // GC before add - int i=0; + int i=0, gced=0; while( i < windowList.size() ) { if( null == windowList.get(i).get() ) { + gced++; windowList.remove(i); } else { i++; } } windowList.add(new WeakReference(window)); + if(DEBUG_IMPLEMENTATION) { + System.err.println("Window.addWindow2List: GCed "+gced+", size "+windowList.size()); + } } } -- cgit v1.2.3