Re: memory leaks - pixbuf
- From: Allen <allenfans gmail com>
- To: Mark Roberts <gtkmm manumark de>
- Cc: gtkmm-list gnome org
- Subject: Re: memory leaks - pixbuf
- Date: Mon, 25 May 2009 23:36:03 +1000
Agree with Mark Roberts very much.
On Mon, May 25, 2009 at 6:49 PM, Mark Roberts
<gtkmm manumark de> wrote:
Dear Marcel!
> I have memory leaks with use of images...
>
> Glib::RefPtr<Gdk::Pixbuf> interfaceimage;
> Image* workimage;
> Gtk::Image *image;
> interfaceimage = Gdk::Pixbuf::create_from_file(imagepath);
> workimage=pixbuftoImage(interfaceimage);
> image->set(interfaceimage);
>
> Image is my type for images...
>
> image->clear();
> interfaceimage.reset();
> interfaceimage=imagetoPixbuf(workimage);
> image->set(interfaceimage);
It seems strange to call image->set() on an uninitialised pointer. This is
surely not how Gtk::Image::set(Glib::RefPtr<Gdk::Pixbuf>) is supposed to
be used.
If you do similar things inside your own type "Image", it is possible that
you manage to circumvent the automatic memory mangement provided by
RefPtr<>. How about posting a small but complete program which includes
your type "Image"? I'm sure we can spot a memory leak, if there is one.
All the best,
Mark
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]