Re: [Java-gnome-developer] Pixbuf memory leak
Brought to you by:
afcowie
|
From: William T. <wil...@gm...> - 2011-10-24 11:20:39
|
On 23 October 2011 15:55, Vreixo Formoso Lopes <met...@ya...> wrote:
> Hi all,
>
> please correct me if I'm wrong, I haven't looked at this since one or two years, but I am pretty
>
> sure about the reason for the leak in the test code. As it never enters gtk main loop, our reference
> to the underlying GdkPixbuf object is never released. That is because we release it in a g_idle
> function that is only executed inside the gtk main loop. So just doing:
>
>
> while (Gtk.eventsPending()) {
> Gtk.mainIterationDo(false);
> }
>
> after Pixbuf creation will solve the memory leak. I've tested it and it works.
>
>
Thanks very much indeed Vrexio, I can confirm running this code after
this fixes the issue in the test and my application. My app is unusual
as it does not have a Gtk.main() loop, presumably I would not have
seen this issue if it did.
Best regards,
Will Temperley
|