mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-193969 Project leak via UIUtil$JBHtmlEditorKit
This commit is contained in:
@@ -2884,13 +2884,8 @@ public class UIUtil {
|
||||
@Override
|
||||
public Document createDefaultDocument() {
|
||||
StyleSheet styles = getStyleSheet();
|
||||
StyleSheet ss = new StyleSheet() {
|
||||
@Override
|
||||
protected int getCompressionThreshold() {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
// static class instead anonymous for exclude $this [memory leak]
|
||||
StyleSheet ss = new StyleSheetCompressionThreshold();
|
||||
ss.addStyleSheet(styles);
|
||||
|
||||
HTMLDocument doc = new HTMLDocument(ss);
|
||||
@@ -2966,6 +2961,13 @@ public class UIUtil {
|
||||
}
|
||||
}
|
||||
|
||||
private static class StyleSheetCompressionThreshold extends StyleSheet {
|
||||
@Override
|
||||
protected int getCompressionThreshold() {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Workaround for https://bugs.openjdk.java.net/browse/JDK-8202529
|
||||
private static class MouseExitSupportLinkController extends HTMLEditorKit.LinkController {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user