Re: Glib::RefPtr and Pointer
- From: Andreas Volz <lists brachttal net>
- To: gtkmm-list gnome org
- Subject: Re: Glib::RefPtr and Pointer
- Date: Thu, 8 Nov 2007 23:39:52 +0100
Am Thu, 08 Nov 2007 08:52:44 +0100 schrieb Murray Cumming:
> Yes. You need to check pointers (or RefPtrs) for null before
> dereferencing them. For instance
> if(list_store)
> list_store->do_something().
After some hours of searching I found the problem.
Glib::RefPtr<Gtk::ListStore> m_refListModel;
...
Now I tried to clear my ListStore:
m_refListModel.clear ();
This compiled nice, but m_refListModel was NULL after calling this.
m_refListModel->clear ();
This worked as I expected. After reading the documentation of RefPtr, I
know the problem. This was a *really* hard to find bug!
regards
Andreas
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]