apparent leak in widget creation/destroy
- From: "Boncek, John" <jboncek hunter com>
- To: <gtk-app-devel-list gnome org>
- Subject: apparent leak in widget creation/destroy
- Date: Fri, 18 Nov 2005 09:56:24 -0600
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]