From 0cd9dad723fb1eae0b30bab9f36318bbd0f2ee3d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 23 Apr 2010 02:50:10 +0200 Subject: Fix: delete Newt window completly (deep) --- src/demos/es1/RedSquare.java | 9 ++++++++- src/demos/es2/RedSquare.java | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/demos') 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"); -- cgit v1.2.3