Beispiel #1
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();
      }
    }
  }