Re: Gtk2::ImageView memory issue



2009/3/7 muppet <scott asofyet org>:
Simplest is to wrap it:

I should have thought of that... Unfortunately, it's not being called. I have:

static void
wrap_gdk_pixbuf_draw_cache_free (void * the_thing)
{
   g_print ("OMG I'M ABOUT TO FREE A GdkPixbufDrawCache AT %p\n", the_thing);
   gdk_pixbuf_draw_cache_free (the_thing);
}

GType
gdk_pixbuf_draw_cache_get_type(void) {
    static GType t = 0;
    if (!t) {
        t = g_boxed_type_register_static("GdkPixbufDrawCache",
                                         (GBoxedCopyFunc) g_boxed_copy,
                                         (GBoxedFreeFunc)
wrap_gdk_pixbuf_draw_cache_free);
    }
    return t;
}

which compiles OK, but just doesn't get called when I undef the $cache
or it goes out of scope.

g_boxed_type_register_static is being called OK, so I guess the
problem is that GBoxedFreeFunc isn't being triggered. But now I am out
of my depth...

Any ideas?

Jeff



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