From 846c0a195ba716f091d09af2940e01d869ab4835 Mon Sep 17 00:00:00 2001 From: incastrix Date: Mon, 23 Mar 2009 21:15:52 +0000 Subject: [PATCH] fix #763. --- .../phpeclipse/xdebug/php/model/XDebugTarget.java | 29 ++++++++++++------- 1 files changed, 18 insertions(+), 11 deletions(-) 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; } } -- 1.7.1