memory leak in standard GtkWindow



I just download precompiled for windows packages of GTK 2.14.1 and GLIB 2.18.0 (the current ones on the gtk.org). I tried to use glib's memory profiler and it reports a memory leak somewhere inside gtk_window_new(). Here is my test program:

#include <glib.h>
#include <gtk/gtk.h>


int main( int argc, char *argv[]) {
	GtkWidget *window;

	gtk_init(&argc, &argv);

	g_mem_set_vtable(glib_mem_profiler_table);
	g_atexit(g_mem_profile);

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect_swapped(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
	gtk_widget_show(window);

	gtk_main();

	return 0;
}



And this simple program fails with report:

(test.exe:1028): GLib-WARNING **: realloc(003E9960, 32): memory has been freed 393221 times already
GLib Memory statistics (successful operations):
blocks of | allocated  | freed      | allocated  | freed      | n_bytes
 n_bytes  | n_times by | n_times by | n_times by | n_times by | remaining
          | malloc()   | free()     | realloc()  | realloc()  |
===========|============|============|============|============|===========
        4 |          0 |          0 |          1 |          1 |         +0
       12 |          2 |          0 |          0 |          2 |         +0
       16 |          1 |          1 |          0 |          0 |         +0
       18 |          0 |          1 |          1 |          0 |         +0
       24 |          2 |          0 |          2 |          4 |         +0
       32 |          0 |          0 |          1 |          1 |         +0
       40 |          2 |          1 |          0 |          0 |        +40
       44 |          2 |          0 |          0 |          2 |         +0
       48 |          0 |          1 |          3 |          2 |         +0
       64 |          0 |          0 |          1 |          1 |         +0
       66 |          1 |          2 |          1 |          0 |         +0
       88 |          0 |          0 |          2 |          2 |         +0
       96 |          0 |          1 |          2 |          1 |         +0
      128 |          0 |          2 |          2 |          0 |         +0
      176 |          0 |          2 |          2 |          0 |         +0
GLib Memory statistics (failing operations):
blocks of | allocated  | freed      | allocated  | freed      | n_bytes
 n_bytes  | n_times by | n_times by | n_times by | n_times by | remaining
          | malloc()   | free()     | realloc()  | realloc()  |
===========|============|============|============|============|===========
       32 |          0 |          0 |          1 |          0 |        +32
Total bytes: allocated=1674, zero-initialized=40 (2.39%), freed=1634 (97.61%), remaining=40

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Any ideas?



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