libseed-list Suspected thread issues with callbacks.
- From: Alan Knowles <alan akbkhome com>
- To: libseed-list gnome org
- Subject: libseed-list Suspected thread issues with callbacks.
- Date: Sat, 23 Jan 2010 20:43:48 +0800
I was wondering if you had some insight into this issue.
Code is here :http://www.akbkhome.com/svn/seed/gtk.js
Basically it's a pretty simple test, creates 2 widgets on a window, a
button, and a treeview.
After the treeview is filled via a Gio async file read, you can press on
any of the tree elements, and it set's the button text to whatever tree
node you pressed.
What I found however was that it would randomly segfault after a few
presses, running gdb, indicated that the exact location of the segfault
was not fixed, and was often inside a gtk internal refresh - unrelated
to the setting code.
My suspicion is that this is due to thread locking (or lack thereof)
with the Javascript code probably running in a different thread to
Gtk.main()..
Do you have any thoughts. (cursor-changed code below for reference - the
gtk.js relies on a data file, so it's a bit difficult to test)
Regards
Alan
'cursor-changed' : function(tv, a) {
var iter = new Gtk.TreeIter();
//console.log('changed');
var s = tv.selection;
s.get_selected(tv.model, iter);
// var val = "";
value = new GObject.Value();
tv.model.get_value(iter, 0, value);
console.log(value.get_string());
// _g.button.set_label(''+value.get_string());
//Seed.print( value.get_string());
return true;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]