Gtk3 and threads



Hi all.

I'm attempting to use threads in a Gtk3 app. It's basically working ( proof-of-concept anyway ), but I get a segfault when exiting. Why am I using threads? I'm adding support for triggering ( long-running ) commands on a remote server, via Net::SSH2. I want to capture the output and display it, as it is generated, in the GUI. I'm planning on using a single shared variable for this - an array that the child thread will append to. Then in the main thread, I'll set up a timer, and push new lines of output into the GUI. Something like that anyway.

When I close the last window, and call Gtk3::main_quit() ... I get:

Base_UI::close_window called in thread [0]
Last window closed ... exiting ...
GLib-GObject-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed during global destruction.
GLib-GObject-CRITICAL **: g_object_steal_qdata: assertion 'G_IS_OBJECT (object)' failed during global destruction.
GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed during global destruction.

These 3 GLib-GObject lines are repeated many times. Then finally:

Segmentation fault

:)

I'm attempting to be careful to not call Gtk3::main_quit() in the child thread ( I log this in the 1st line pasted above ). The 'Last window closed ...' line is logged IMMEDIATELY before calling Gtk3::main_quite(). I'm not really sure what's going on here. Any ideas?

Dan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]