Changeset 1643

Show
Ignore:
Timestamp:
03/23/09 16:15:52 (3 months ago)
Author:
incastrix
Message:

fix #763.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/net.sourceforge.phpeclipse.xdebug.core/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugTarget.java

    r1635 r1643  
    601601         
    602602        public void handleProxyEvent(XDebugConnection connection) { 
    603                 setDebugConnection(connection); 
    604603                //System.out.println("* New Connection - XDebug.Target: " + fDebugConnection.getSessionID()); 
    605604                 
    606                 fThread = new XDebugThread(this); 
    607                 fThreads = new IThread[] {fThread}; 
    608                 fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE)); 
    609                 try { 
    610                         started(); 
    611                 } catch( DebugException e ){ 
    612                         e.printStackTrace();             
    613                 }                
    614         } 
    615  
    616         private void setDebugConnection(XDebugConnection connection) { 
    617                 if (connection != null) { 
     605                if (setDebugConnection(connection)) { 
     606                        fThread = new XDebugThread(this); 
     607                        fThreads = new IThread[] {fThread}; 
     608                        fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CHANGE)); 
     609                        try { 
     610                                started(); 
     611                        } catch( DebugException e ){ 
     612                                e.printStackTrace();             
     613                        } 
     614                } 
     615        } 
     616 
     617        private boolean setDebugConnection(XDebugConnection connection) { 
     618                if (connection != null && fDebugConnection == null) { 
    618619                        fDebugConnection = connection; 
    619620                        fResponseListener = new ResponseListener(connection); 
    620621                        startListener(); 
     622                         
     623                        return true; 
     624                } else { 
     625                        connection.close(); 
     626                         
     627                        return false; 
    621628                } 
    622629        }