aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-07-04 23:04:20 +0200
committerSven Gothel <[email protected]>2013-07-04 23:04:20 +0200
commit0e8cd28f916d10f3d588114eebc903902675f063 (patch)
treeeaca676b27c18caf991755281c068a0504378e78 /src/newt
parentfeb352145af1643a57eaae99c0342e6f5e0f2a2e (diff)
NEWT WindowImpl: Add little GCed / windowList-size stats at addWindow2List
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java6
1 files changed, 5 insertions, 1 deletions
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<WindowImpl>(window));
+ if(DEBUG_IMPLEMENTATION) {
+ System.err.println("Window.addWindow2List: GCed "+gced+", size "+windowList.size());
+ }
}
}