[Glade-users] memory management for treeview in dialog



On Thu, 11 Aug 2005 09:30 pm, Damon Chaplin wrote:
It looks OK. It looks like you've unref'ed all the objects properly.

On Linux you could use valgrind to spot a memory leak quite easily.
I don't know if there are free tools like that on windows.

Try simplifying the app (e.g. don't append the rows), and see if the
memory behavior is different.

It could just be fragmented memory rather than a leak.

Damon

Damon

This is driving me crazy. In my big application I have a callback on a 
menuitem:

void on_assgt1_activate (GtkMenuItem *menuitem, gpointer user_data)
{
        GtkWidget *w;
        w=create_dialog4();
        gtk_widget_show(w);
}

the callback on the ok button is

on_okbuton2_clicked (GtkButton *button, gpointer user_data)
{
        GtkWidget *w;
        w=lookup_widget(GTK_WIDGET(button));
        gtk_widget_destroy(w);
}

In a small test project, no memory leak. When I do this in my bigger 
application, memory gets consumed every time I open and close the dialog. I 
tried to use g_free(w) after the destroy_widget call, but the app crashes 
after the third attempt to call on_okbutton2_clicked.

I just don't get it. Ideas?

Kim



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