summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-04-23 02:50:10 +0200
committerSven Gothel <[email protected]>2010-04-23 02:50:10 +0200
commit0cd9dad723fb1eae0b30bab9f36318bbd0f2ee3d (patch)
treecf516b212cf99ae9c1570e85ab09ded7a3a61b94 /src
parent4b64268876f5da41bd7c9deb04191b2145b573e8 (diff)
Fix: delete Newt window completly (deep)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/demos/es1/RedSquare.java9
-rwxr-xr-xsrc/demos/es2/RedSquare.java2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java
index 9f810d4..91534a7 100755
--- a/src/demos/es1/RedSquare.java
+++ b/src/demos/es1/RedSquare.java
@@ -174,7 +174,7 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
}
window = null;
if(null!=nWindow) {
- nWindow.destroy();
+ nWindow.destroy(true);
nWindow=null;
}
System.out.println("SHUTDOWN "+Thread.currentThread()+" FIN");
@@ -349,6 +349,7 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
NewtFactory.setUseEDT(useEDT); // true is the default
+ System.out.println(Thread.currentThread()+" RedSquare.main: Start - oneThread: "+oneThread);
if(!oneThread) {
for(Iterator i = threads.iterator(); i.hasNext(); ) {
((Thread)i.next()).start();
@@ -356,6 +357,7 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
boolean done = false;
+ int lastAliveCount = 0;
while(!done) {
int aliveCount = 0;
for(Iterator i = threads.iterator(); i.hasNext(); ) {
@@ -366,6 +368,10 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
aliveCount++;
}
}
+ if(lastAliveCount != aliveCount) {
+ System.out.println(Thread.currentThread()+" RedSquare.main: alive changed: "+lastAliveCount+" -> "+aliveCount);
+ }
+ lastAliveCount = aliveCount;
done = 0==aliveCount ;
}
} else {
@@ -385,5 +391,6 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
}
}
}
+ System.out.println(Thread.currentThread()+" RedSquare.main: FIN");
}
}
diff --git a/src/demos/es2/RedSquare.java b/src/demos/es2/RedSquare.java
index 2099fd0..975a3f9 100755
--- a/src/demos/es2/RedSquare.java
+++ b/src/demos/es2/RedSquare.java
@@ -149,7 +149,7 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo
}
window = null;
if(null!=nWindow) {
- nWindow.destroy();
+ nWindow.destroy(true);
nWindow=null;
}
System.out.println("SHUTDOWN "+Thread.currentThread()+" cleanly");