GtkBuilder causing memory leaks?



The following code spawns a window --

if (connect_build_object != NULL) {
    g_object_unref (G_OBJECT ( connect_build_object ));
    object = NULL;
}
    connect_build_object = gtk_builder_new();
gtk_builder_add_from_file ( connect_build_object, "main_window.glade", NULL );
    gtk_builder_connect_signals ( connect_build_object, NULL );
connect_window = GTK_WIDGET ( gtk_builder_get_object ( connect_build_object, "connec" ) );
    gtk_widget_show ( connect_window );

Where connect_build_object is a global variable.

Before spawning, it's checked if connect_build_object is initilized, if that's the case, its destroyed by g_object_unref.

Closing the window calls the default handler.

Problem: Each time I open and close a window, memory usage increases.

I don't understand the problem. Please help!


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