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 112321 - Gtk::Image::get_pixbuf problems unreferencing Glib::RefPtr PATCH
Gtk::Image::get_pixbuf problems unreferencing Glib::RefPtr PATCH
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.2
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2003-05-05 17:54 UTC by ec142
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for the reported bug (3.68 KB, patch)
2003-05-05 17:58 UTC, ec142
none Details | Review

Description ec142 2003-05-05 17:54:32 UTC
I am trying to create a Gtk::Image from a Gdk::Pixbuf and then update 
the same pixbuf. i.e.:
Gdk::Pixbuf *pixbuf;
Gtk::Image *image;
pixbuf = Gdk::Pixbuf::create_from_file("1.png");
image = manage( new Gtk::Image(pixbuf) );
pixbuf = image->get_pixbuf();

but I get:
(test:1769): GLib-GObject-CRITICAL **: file gobject.c: line 1337 
(g_object_unref): assertion `G_IS_OBJECT (object)' failed

If I create the image from a copy of the pixbuf (using pixbuf->copy in 
the image constructor), I get the same.

I submit a patch (see ChangeLog) done under guidance from Murray Cummings.
I have tested the changes with positive results.
Comment 1 ec142 2003-05-05 17:58:09 UTC
Created attachment 16275 [details] [review]
patch for the reported bug
Comment 2 Murray Cumming 2003-05-07 16:34:47 UTC
Applied. Thanks.