Re: Gtk 0.7006: Memory leak in Gdk::Pixmap?



On 05/18/01 dov imagic weizmann ac il wrote:
I reported about this a while ago, but I didn't find a real solution
to it. In the end I made a very ugly work around by adding an 
additional  gdk_pixbuf_unref(self);  in GdkPixbuf/xs/GdkPixbuf.c
and then manually doign $pixbuf->DESTROY() to have this 
function called. 

I hope I'll have time to look in to it, but if someone with more
experience and time could do it, that would be great.

I fixed both leaks in cvs: they were related.
Basically we maintain an hash table where we store the mapping between
the C pointer and the perl data structure that is used to represent it
to perl code.
When we first insert an item in this hash table, we increase the reference
count on the C object. The problem is that if it's the binding that
created the C object in the first place, it already owns the reference
count and so doesn't need to increase it. This problem was common
to other boxed types as well such as Gtk::Style...

lupus

-- 
-----------------------------------------------------------------
lupus debian org                                     debian/rules
lupus ximian com                             Monkeys do it better




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