Avoid double client destroy in case of webview close #537.
authorDaniel Carl <danielcarl@gmx.de>
Wed, 13 Feb 2019 21:55:43 +0000 (22:55 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Wed, 13 Feb 2019 21:55:43 +0000 (22:55 +0100)
src/main.c
tests/manual/js-window-close.html [new file with mode: 0644]

index 71a4007..b2cf5c6 100644 (file)
@@ -1195,7 +1195,7 @@ static void on_webdownload_received_data(WebKitDownload *download,
  */
 static void on_webview_close(WebKitWebView *webview, Client *c)
 {
-    client_destroy(c);
+    gtk_widget_destroy(c->window);
 }
 
 /**
diff --git a/tests/manual/js-window-close.html b/tests/manual/js-window-close.html
new file mode 100644 (file)
index 0000000..160d615
--- /dev/null
@@ -0,0 +1,9 @@
+<html>
+<head>
+<title>JS Window Close</title>
+</head>
+<body>
+Click on following link should close the window without crashing.<br>
+<a href="#" onclick="window.close()">Close this window</a>
+</body>
+</html>