[Vala] [Gtk+ 3.0] Using ListStore.get() causes a segfault



Hello,

I'm writing a program which uses an IconView for users to pick filters they
want to apply to their photos, a la Instagram. The problem is that whenever
I try to access a value that's stored in the underlying ListStore, I get a
segmentation fault (however, when I do in fact pass an unassigned string, I
get compiler errors). Is there any way around that?

Code:

[CCode (instance_pos = -1)]
public void on_filter_selected (Event e) {
    var list = filterchooser.get_selected_items();
    foreach (var path in list) {
        TreeIter t_iter;
        string s_value; // Empty/unassigned string
        if(filterchooser_liststore.get_iter(out t_iter, path)){
            filterchooser_liststore.get(t_iter, 1, out s_value, -1); //
This breaks it.
            stderr.printf("Selection: %s\n", s_value);
        }
    }
}

Thanks,
Filip

-- 
_____________________
Filip Lamparski - FB <https://www.facebook.com/filip.lamparski> -
G+<https://plus.google.com/105688569486178456264/posts>


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