1) Fire 'Terminate' event on every thread on script termination. Fixes bug #1548528.
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.core / src / net / sourceforge / phpdt / internal / debug / core / model / PHPDebugTarget.java
index afce149..6ac564e 100644 (file)
@@ -168,6 +168,17 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget,
        public synchronized boolean isTerminated() {
                return state.isTerminated();
        }
+       
+       private synchronized void terminateThreads () {
+               int i;
+               
+               try {
+                       for (i = 0; i < threads.length; i++) {
+                               threads[i].terminate ();
+                       }
+               } catch (DebugException e) {
+               }
+       }
 
        public synchronized void terminate() {
                // This method is synchronized to control a race condition between the
@@ -178,6 +189,7 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget,
                        return;
                state.setTerminated(true);
                phpDBGProxy.stop();
+               terminateThreads ();
                this.threads = new PHPThread[0];
                fireChangeEvent();
                IBreakpointManager manager = DebugPlugin.getDefault()