Re: gtk_widget_get_snapshot



On Sat, 06 Dec 2008 18:28:41 +0300, Lucas Hermann Negri <kkndrox gmail com> wrote:

Hello,

gtk_widget_get_snapshot seems to leak some memory (or I'm doing it wrong).

I tested with:

for(;;)
{
    GdkPixmap* pix = gtk_widget_get_snapshot(wdg, NULL);
    g_object_unref(pix);
}

The memory grows forever! I'm missing something?

Thanks.


Hi.
I also tested, but i modified so:

        int p = 0;
        for(;;)
        {
GdkPixmap* pix = gtk_widget_get_snapshot(main_window, NULL);
                g_object_unref( pix );
                p++;
                printf("--------- DEBUG: p == %d\n", p);
        }


And i tested for p == 1106762 but i did'n notice to leak some memory.


At the begining:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
11505 vdim      20   0  195m  15m 8584 S    0  0.8   0:00.50 lt


At the finishing:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
11505 vdim      20   0  195m  15m 8580 S   11  0.8   0:05.60 lt


May be, did I test for small "p"?


Gtk2 - 2.14.4.
OS - Opensuse 11 (amd64).

--
Vyacheslav D.


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