memprof reports memory leak with GtkCalendar



memprof finds a memory leak when I use the GtkCalendar widget.

The attached test program demonstrates this:
It creates a window with a button, which, when clicked, pops up another
window containing a calendar.
As I understand GTK, closing this window should properly destroy the calendar.

I have also attached the memprof leak information after running the test
program with debug versions of the GTK libraries, and popping up a calendar
twice.

Is this a true leak?  Or is memprof misreporting?

System information:
GTK 1.2.8 from the Helixcode Debian packages.

[~]$ dpkg -s libgtk1.2-dev
Package: libgtk1.2-dev
Installed-Size: 2628
Maintainer: Helix Code, Inc. <debian helixcode com>
Source: gtk+1.2
Version: 1.2.8-helix2

-- 
Evan Martin - eeyem u washington edu
http://students.washington.edu/eeyem
/* vim: ts=4 sw=4
*/
#include <gtk/gtk.h>

void new_calendar() {
	GtkWidget *win;
	GtkWidget *cal;

	win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	cal = gtk_calendar_new();
	gtk_container_add(GTK_CONTAINER(win), cal);
	gtk_widget_show_all(win);
}

int main(int argc, char* argv[]) {
	GtkWidget *button, *win;
	gtk_init(&argc, &argv);

	win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	button = gtk_button_new_with_label("calendar");
	gtk_signal_connect(GTK_OBJECT(button), "clicked",
			GTK_SIGNAL_FUNC(new_calendar), NULL);
	gtk_container_add(GTK_CONTAINER(win), button);
	gtk_widget_show_all(win);

	gtk_main();
	return 0;
}

Attachment: memprof.leak.gz
Description: Binary data



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