From: incastrix Date: Mon, 23 Mar 2009 21:15:52 +0000 (+0000) Subject: fix #763. X-Git-Url: http://git.phpeclipse.com?hp=31d6ec5af4940abfb6757ac0534128371677d625 fix #763. --- diff --git a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugTarget.java b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugTarget.java index 36b4569..06064eb 100644 --- a/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugTarget.java +++ b/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugTarget.java @@ -600,24 +600,31 @@ public class XDebugTarget extends XDebugElement implements IDebugTarget, IDebugE } public void handleProxyEvent(XDebugConnection connection) { - setDebugConnection(connection); //System.out.println("* New Connection - XDebug.Target: " + fDebugConnection.getSessionID()); - fThread = new XDebugThread(this); - fThreads = new IThread[] {fThread}; - fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE)); - try { - started(); - } catch( DebugException e ){ - e.printStackTrace(); - } + if (setDebugConnection(connection)) { + fThread = new XDebugThread(this); + fThreads = new IThread[] {fThread}; + fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE)); + try { + started(); + } catch( DebugException e ){ + e.printStackTrace(); + } + } } - private void setDebugConnection(XDebugConnection connection) { - if (connection != null) { + private boolean setDebugConnection(XDebugConnection connection) { + if (connection != null && fDebugConnection == null) { fDebugConnection = connection; fResponseListener = new ResponseListener(connection); startListener(); + + return true; + } else { + connection.close(); + + return false; } }