1) Fire 'Terminate' event on every thread on script termination. Fixes bug #1548528.
authorrobekras <robekras>
Tue, 29 Aug 2006 12:38:07 +0000 (12:38 +0000)
committerrobekras <robekras>
Tue, 29 Aug 2006 12:38:07 +0000 (12:38 +0000)
net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPDebugTarget.java
net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/model/PHPThread.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()
index 94feaf9..fefd85e 100644 (file)
@@ -301,6 +301,7 @@ public class PHPThread extends PHPDebugElement implements IThread {
                state.setTerminated (true);
                this.frames = null;
                getDebugTarget ().terminate ();
+               fireTerminateEvent ();
        }
 
        /**
@@ -334,8 +335,7 @@ public class PHPThread extends PHPDebugElement implements IThread {
                                }
                        };
                }
-
-               return null;
+               return super.getAdapter(arg0);
        }
 
        /**