Browse Source

CHART-23172 & CHART-23111 v7的jxbrowser没有正确关闭engine

final/11.0
WeiYanglu 3 years ago
parent
commit
b069132341
  1. 6
      designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/ui/compatible/ModernUIPaneFactory.java
  3. 11
      designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java

6
designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java

@ -196,13 +196,17 @@ public class ModernUIPane<T> extends BasicPane {
private ModernUIPane<T> pane;
public Builder() {
this(BrowserType.HEAVYWEIGHT);
}
public Builder(BrowserType browserType) {
this.pane = new ModernUIPane<>(browserType);
}
public Builder<T> init() {
this.pane = new ModernUIPane<>(BrowserType.HEAVYWEIGHT);
return this;
}
public Builder<T> prepare(ScriptContextListener contextListener) {
pane.browser.addScriptContextListener(contextListener);
return this;

4
designer-base/src/main/java/com/fr/design/ui/compatible/ModernUIPaneFactory.java

@ -13,9 +13,9 @@ public class ModernUIPaneFactory {
public static <T> ModernUIPane.Builder<T> modernUIPaneBuilder() {
if (isV7()) {
return new NewModernUIPane.Builder<>();
return new NewModernUIPane.Builder<T>().init();
} else {
return new ModernUIPane.Builder<>();
return new ModernUIPane.Builder<T>().init();
}
}

11
designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java

@ -182,8 +182,7 @@ public class NewModernUIPane<T> extends ModernUIPane<T> {
public void disposeBrowser() {
if (browser != null) {
browser.close();
browser = null;
browser.engine().close();
}
}
@ -204,7 +203,13 @@ public class NewModernUIPane<T> extends ModernUIPane<T> {
public static class Builder<T> extends ModernUIPane.Builder<T> {
private NewModernUIPane<T> pane = new NewModernUIPane<>();
private NewModernUIPane<T> pane;
@Override
public ModernUIPane.Builder<T> init() {
this.pane = new NewModernUIPane<>();
return this;
}
public NewModernUIPane.Builder<T> prepare(InjectJsCallback callback) {
pane.browser.set(InjectJsCallback.class, callback);

Loading…
Cancel
Save