[gtkmm] Storing Glib::RefPtrs in treemodels



I have a Gtk::TreeStore subclass which has as one of its columns a
Glib::TreeModelColumn<Glib::RefPtr<Towel::TrackStore> > where
Towel::TrackStore is a subclass of Gtk::ListStore. When a row is added
to this TreeStore, the relevant column is populated with
Towel::TrackStore::create(), which returns a RefPtr with a TrackStore
inside it as one might expect.

The trouble is, every time the program tries to access the column, Glib
claims

(towel:9825): GLib-GObject-CRITICAL **: file gobject.c: line 1583
(g_value_get_object): assertion `G_VALUE_HOLDS_OBJECT (value)' failed

And I have no idea why this might be, because I am sure that
everything's being created properly. Do I perhaps not understand how
RefPtrs work properly? Should I perhaps be doing this in a completely
different manner? I suppose I could store straight pointers instead, but
that would increase the complexity of the memory management code, which
I'm trying not to do because it's a horrible source of nasty bugs.

Anyone have any ideas?

Thanks

Matthew

-- 
Matthew Walton <matthew alledora co uk>




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