openjdk-jfx icon indicating copy to clipboard operation
openjdk-jfx copied to clipboard

[WebView] jvm not stopping after playing a GIF

Open jcharun opened this issue 7 years ago • 1 comments

If you display some gifs into the WebView and you close the application window, the java process hang. The issue is 100% reproducible on jdk 8 and jfx 11, Windows and macOS.

This test case use https://giphy.com but i can reproduce it on any website.

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception{
        WebView webView = new WebView();
        webView.getEngine().load("https://giphy.com");
        primaryStage.setTitle("Hello World");
        primaryStage.setScene(new Scene(webView));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

A workaround is to call webView.getEngine().load("") on javafx stop method.

jcharun avatar Oct 07 '18 14:10 jcharun

Test Configuration: JDK 12 and JavaFX 12 Result: I don't have the issue so it seams to be solved BUT I have a silent error after few pages from giphy.com:

com.sun.javafx.webkit.prism.WCMediaPlayerImpl onError WARNING: onError, errCode=270, msg=ERROR_MEDIA_CORRUPTED

I do not get this error on another website that does not have GIFs.

Other issue: However sometimes, after few gifs played (from giphy.com), the next ones get stuck.

ghost avatar Apr 11 '19 06:04 ghost