[pygtk] out of memory

mammique mammique at lamenagerie.com
Tue May 11 09:03:57 WST 2004


Hi,

i'm trying to make a litte function wich changes randomly a
gtk.Pixmap(pixmap, mask). But each time i call this function the program
takes more and more system memory, until system or X-server dies. What
do i do wrong for a such thing to happen ?

def switch(self, widget):
    images = ['1.png', '2.png', '3.png']
    self.pixbuf = gtk.gdk.pixbuf_new_from_file(
                  images[random.randint(0, 2)])
    pixmap, mask = self.pixbuf.render_pixmap_and_mask()
    self.pixmap.set(pixmap, mask)

Thank you.

Regards.

-- 
mammique <mammique at lamenagerie.com>



More information about the pygtk mailing list