After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 583037 - Reference counting for return value of Gtk::IconView::get_model() is not proper
Reference counting for return value of Gtk::IconView::get_model() is not proper
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2009-05-18 12:52 UTC by Santanu Sinha
Modified: 2009-05-18 15:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Santanu Sinha 2009-05-18 12:52:43 UTC
Please check: http://git.gnome.org/cgit/gtkmm/tree/gtk/src/iconview.hg line:58
Now look at: http://git.gnome.org/cgit/gtkmm/tree/gtk/src/treeview.hg line 124

in iconview.hg the definition should be:
_WRAP_METHOD(Glib::RefPtr<TreeModel> get_model(), gtk_icon_view_get_model, refreturn)

Due to this the following code will lead to overall application crash:

Item SomeDerivedClassFromIconView::get_item_from_path( 
                                      const Gtk::TreeModel::Path &path )
{
  const TreeViewPtr &model = get_model();
  //Do some thing to get item
  return item;
}

As a work-around we are using:
Item SomeDerivedClassFromIconView::get_item_from_path( 
                                      const Gtk::TreeModel::Path &path )
{
  const TreeViewPtr &model = get_model();
  g_object_ref( model->gobj() );

  //Do some thing to get item
  return item;
}
Comment 1 Murray Cumming 2009-05-18 15:59:54 UTC
Yes. Corrected in git. Thanks.