[webkit-gtk] webkit_web_view_run_javascript won't run if excuted after gtk_main

Alberto Garcia berto at igalia.com
Wed Mar 24 10:22:09 PDT 2021


On Wed, Mar 24, 2021 at 05:12:00PM +0000, MrBn100ful wrote:

> static void destroyWinCb(GtkWidget* widget, GtkWidget* window)
> {
> gtk_main_quit();
> }

  /*...*/
> webkit_web_view_run_javascript (web, script, NULL, NULL, NULL);
> 
> gtk_main();
> 
> webkit_web_view_run_javascript (web, script, NULL, NULL, NULL);

In your example, gtk_main() returns when the window (and its embedded
WebView) has been destroyed. That's why you cannot use the WebView
anymore, it no longer exists.

Berto


More information about the webkit-gtk mailing list