mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixes for IDEA-CR-15226
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package com.intellij.debugger.jdi;
|
||||
|
||||
import com.intellij.Patches;
|
||||
import com.intellij.debugger.engine.DebugProcess;
|
||||
import com.intellij.debugger.engine.DebugProcessImpl;
|
||||
import com.intellij.debugger.engine.DebuggerManagerThreadImpl;
|
||||
@@ -333,12 +334,14 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
|
||||
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();
|
||||
if (Patches.JDK_BUG_EVENT_CONTROLLER_LEAK) {
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,11 @@ public class Patches {
|
||||
*/
|
||||
public static final boolean JDK_BUG_ID_8042123 = !SystemInfo.isJavaVersionAtLeast("1.8.0_40");
|
||||
|
||||
/**
|
||||
* Enable workaround for jdk bug with leaking TargetVM.EventController, see IDEA-163334
|
||||
*/
|
||||
public static final boolean JDK_BUG_EVENT_CONTROLLER_LEAK = true;
|
||||
|
||||
/**
|
||||
* JDK on Mac detects font style for system fonts based only on their name (PostScript name).
|
||||
* This doesn't work for some fonts which don't use recognizable style suffixes in their names.
|
||||
|
||||
Reference in New Issue
Block a user