gtkevent memory leak



It seems that gtkentry has some memory leaks.  Ignore the
glib_set_memtrace() calls.  I seem to have to call
g_signal_handlers_destroy() because there are several signal handlers
assigned to im_context in gtk_entry_init().  I guess these should be dealt
with in gtk_entry_finalize().

#include <gtk/gtk.h>
int main(int argc, char *argv[])
{
  GtkWidget *widget;
  extern void glib_set_memtrace(int);

  gtk_init (&argc, &argv);

  widget = gtk_entry_new();
  gtk_widget_destroy(widget);
  g_free(widget);

  glib_set_memtrace(1);

  widget = gtk_entry_new();

  g_signal_handlers_destroy(GTK_ENTRY(widget)->im_context);
  gtk_widget_destroy(widget);

  g_free(widget);

  glib_set_memtrace(0);

  return 0;
}

Brandon Reynolds              mailto:bmr comtime com
Systems Engineer                  Ph: (330) 644-3059
Commercial Timesharing Inc.      Fax: (330) 644-8110




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