Re: [gtkmm] Pixbuf memory management



On Mon, 2002-10-28 at 20:52, Jussi Pakkanen wrote:
> The problem is this: when and who should free the
> temporary array of RGB values I constructed? The
> documentation seems to implicate that creating the
> pixbuf does not make a copy of the data. This seems a
> little counterintuitive. I just want to create a
> pixbuf from my temporary data and then delete it
> without affecting the pixbuf.

Yes, it looks like you need to keep the data around for as long as the
pixbuf. The documentation for the underlying structure does seem to
suggest that we could change it, by taking a copy (maybe inefficiently)
and supplying a callback to delete it:
http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-creating.html#gdk-pixbuf-new-from-data

But I think it's too late for that. If you submit a patch then we can
consider it for the next API break.

-- 
Murray Cumming
murray usa net
www.murrayc.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]