apparent leak in widget creation/destroy



We have 2 large C++ application programs using GTK 2.2.4 which have had
persistent problems in running out of memory.  We have narrowed the
problem down to a small test case, shown below, which consumes all
available memory until locking up the system.  We run this test case with
the free command in another terminal window to show free memory on a
half-second cycle, thus:
        free -o -m -s 0.5
The widget-creation call can be either gtk_fixed_new or
gtk_drawing_area_new.

Are we missing something, or is this really a leak as it appears?


/*
        Simple application to demonstrate leak.
*/


#include "gtk/gtk.h"


int             main( 
        int                     argc, 
    char *              argv    []
)
{
        // initialize GTK
        gtk_init(&(argc), &(argv));

        while (true) {
                
            GtkWidget *         pWidget         = gtk_fixed_new();      //
or gtk_drawing_area_new
                gtk_widget_destroy(pWidget);
                
                while (gtk_events_pending()) {
                gtk_main_iteration();
                } // end while

        } // end while

        return 0;       
        
} // main



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