Skip to content

Commit

Permalink
NEWT WindowImpl: Add little GCed / windowList-size stats at addWindow…
Browse files Browse the repository at this point in the history
…2List
  • Loading branch information
sgothel committed Jul 4, 2013
1 parent feb3521 commit 0e8cd28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/newt/classes/jogamp/newt/WindowImpl.java
Expand Up @@ -109,15 +109,19 @@ public static final void shutdownAll() {
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());
}
}
}

Expand Down

0 comments on commit 0e8cd28

Please sign in to comment.