RE: [gtkmm] Glib::Object inheritance in Gtk::Object



> From: Maurizio Umberto Puxeddu [mailto:mauriziopuxeddu yahoo it] 
> I restructured my application using Glib::RefPtr<> in several 
> places and
> now I sometimes get unreference() called with this = 0. I can 
> reproduce
> the problem quite easily.
> 
> I have a base class for object that can be annotated
> 
> class Annotated : public Glib::ObjectBase {
> 	...
> };
> 
> I also have a UI component which allows the user to edit the notes:
> NotesControllerUi. This controller takes a Glib::RefPtr<Annotated>.
> 
> Some of the annotated classes are Canvas (my own) and derive from both
> Annotated and Gtk::VBox.

Glib::RefPtr<> is not (yet) meant for use with widgets. Also, it is not a
general-purpose smartpointer - it might be better to find a general purpose
smartpointer for your needs.

Murray Cumming
murrayc usa net
www.murrayc.com 



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