Re: How to convert a jpg image to a GtkImage ?
- From: "Jonathan Winterflood" <jonathan winterflood gmail com>
- To: tom mmto org
- Cc: gtk-app-devel-list gnome org
- Subject: Re: How to convert a jpg image to a GtkImage ?
- Date: Tue, 11 Sep 2007 22:29:45 +0200
Hi,
You could clone the
pixbuf, or create a new one the same size and blit the content of the
soon-to-be recycled one into the new one before unref'ing the loader
Jonathan
On 9/11/07, Tom Trebisky <tom mmto org> wrote:
Following this thread, I decided it would be wise to avoid this kind
of leak since my application uses hundreds of loaders to load
hundreds of pixbufs, so I made my code look like:
pixbuf_p = gdk_pixbuf_loader_get_pixbuf(my_loader);
g_object_unref ( my_loader);
add_to_my_list ( pixbuf_p );
However, this apparently frees up the pixbuf as well, and everything goes
to hell in a handbasket as pixbuf_p is now a reference to some piece
of recycled memory or something like that. How does one free up the
loader but retain the pixbuf ?
Tom
--
Tom Trebisky
MMT Observatory
University of Arizona -- Tucson
tom mmto org
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
<Morpheus> linux, c'est une question de VI ou de MORE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]