[webkit-gtk] Operation webkit_web_view_new() crashed when in multithreading

Michael Catanzaro mcatanzaro at igalia.com
Tue Nov 18 06:43:21 PST 2014


On Tue, 2014-11-18 at 17:31 +0800, 刘阳 wrote:
> Can anyone figure me out, what should i do next, to get multithreading
> use WebKitWebView objects without GUI ?

Hi,

GTK+ is not thread safe, so all GTK+ calls must always occur in the main
thread. WebKitWebView is a GtkWidget and accordingly it's only safe to
use from the main thread.

You can use other threads to perform slow operations, then schedule work
to be performed on the main thread with gdk_threads_add_idle() or
gdk_threads_add_timeout() [1].

Hope that helps,

Michael

[1] https://developer.gnome.org/gdk3/stable/gdk3-Threads.html



More information about the webkit-gtk mailing list