Ejemplo n.º 1
0
 public void disposeVM() {
   try {
     if (vm != null) {
       vm.dispose();
       vm = null;
     }
   } finally {
     if (process != null) {
       process.destroy();
       process = null;
     }
     waitOutputComplete();
   }
 }
Ejemplo n.º 2
0
 /** Disconnects from running debugged process. */
 public void disconnect() throws DebuggerException {
   if (breakpointMain != null) {
     for (int x = 0; x < breakpointMain.length; x++) breakpointMain[x].remove();
     breakpointMain = null;
   }
   try {
     if (virtualMachine != null) virtualMachine.dispose();
   } catch (VMDisconnectedException e) {
   }
   if (threadManager != null) threadManager.finish();
   if (debuggerThread != null) {
     debuggerThread.interrupt();
     debuggerThread.stop();
   }
   super.finishDebugger();
 }
Ejemplo n.º 3
0
  public void dispose() {
    try {
      myVirtualMachine.dispose();
    } catch (UnsupportedOperationException e) {
      LOG.info(e);
    }

    // Memory leak workaround, see IDEA-163334
    TargetVM target =
        ReflectionUtil.getField(
            myVirtualMachine.getClass(), myVirtualMachine, TargetVM.class, "target");
    if (target != null) {
      Thread controller =
          ReflectionUtil.getField(target.getClass(), target, Thread.class, "eventController");
      if (controller != null) {
        controller.stop();
      }
    }
  }