Sorry if this is a dupe but my message from last night didn't seem to make it on to the list.

I'm trying to figure out how to use gtk.gdk.Pixbuf in such a way that it doesn't consume all the memory in the system. Part of my app is a list of thumbnail views of pictures each of which I create with sequence that look like this:

for image_path in images:
pb = gtk.gdk.pixbuf_new_from_file(image_path)
npb = pb.scale_simple(thumb_width, thumb_height, gtk.gdk.INTERP_BILINEAR)
thumb_list_model.set_value(thumb_list_model.append(None), 0, npb)


The problem is that memory consumption seems to grow rapidly without bound making it useless for anything more than a half a dozen or so images.

Is there some trick to tell the pixbuf to free it's memory or to tell python to free the pixbuf? I tried throwing in "del pb" at the end of the loop but it made no difference.

When I get a chance I'm going to try to debug this and see if I can figure out if pyobject_dealloc is never being called or if it's somehow not freeing the memory. If someone has a suggestion for an easy way to do this debugging, let me know. My best idea so far is just to put some printf's in the key places of pygobject.c


_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to