memory leaks - pixbuf



I have memory leaks with use of images...
I think that is pixbufs
I use pixbufs, loading like this:

        Glib::RefPtr<Gdk::Pixbuf> interfaceimage;
         Image* workimage;
         Gtk::Image *image;
         interfaceimage = Gdk::Pixbuf::create_from_file(imagepath);
         workimage=pixbuftoImage(interfaceimage);
         image->set(interfaceimage);

Image is my type for images...

Then i process my workimage and want to change image in GUI
I do this:
            image->clear();
            interfaceimage.reset();
            interfaceimage=imagetoPixbuf(workimage);
            image->set(interfaceimage);
A don't know if this is the right way, then i think that old pixbuf continue in the memory

Best regards!






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