set references to null after event queue emptying
authorEugene Zhuravlev <jeka@intellij.com>
Thu, 4 Mar 2010 17:11:38 +0000 (20:11 +0300)
committerEugene Zhuravlev <jeka@intellij.com>
Thu, 4 Mar 2010 17:11:38 +0000 (20:11 +0300)
java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java

index e9cd41bdbc0f0e4704dc490d02fd480ba38c98e5..395ae31245f8b8552fcebef42ed2319ca8147cdd 100644 (file)
@@ -738,13 +738,12 @@ public abstract class DebugProcessImpl implements DebugProcess {
     DebuggerManagerThreadImpl.assertIsManagerThread();
     
     if (myState.compareAndSet(STATE_INITIAL, STATE_DETACHING) || myState.compareAndSet(STATE_ATTACHED, STATE_DETACHING)) {
-      myVirtualMachineProxy = null;
-      myPositionManager = null;
-
       try {
         getManagerThread().close();
       }
       finally {
+        myVirtualMachineProxy = null;
+        myPositionManager = null;
         myState.set(STATE_DETACHED);
         try {
           myDebugProcessDispatcher.getMulticaster().processDetached(this, closedByUser);