Plug a small memory leak

svn path=/trunk/; revision=20831
This commit is contained in:
Matthias Clasen 2008-07-15 05:00:42 +00:00
parent f9d2ecfb18
commit 69dcbadd00
2 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,15 @@
2008-07-15 Matthias Clasen <mclasen@redhat.com>
Bug 507394 mem leak from gtk_selection_add_targets
* gtk/gtkoldeditable.c: Free target lists in finalize.
Reported by Christian Persch
2008-07-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk.symbols:
* gtk/gtktypeutils.[hc]: Complete the deprecation of gtk_type_class.
2008-07-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtklabel.c: Trivial doc fix.

View File

@ -126,6 +126,7 @@ static gboolean gtk_old_editable_get_selection_bounds (GtkEditable *editable,
static void gtk_old_editable_set_position (GtkEditable *editable,
gint position);
static gint gtk_old_editable_get_position (GtkEditable *editable);
static void gtk_old_editable_finalize (GObject *object);
static guint editable_signals[LAST_SIGNAL] = { 0 };
@ -136,12 +137,16 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkOldEditable, gtk_old_editable, GTK_TYPE_WID
static void
gtk_old_editable_class_init (GtkOldEditableClass *class)
{
GObjectClass *gobject_class;
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
gobject_class = (GObjectClass*) class;
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
gobject_class->finalize = gtk_old_editable_finalize;
object_class->set_arg = gtk_old_editable_set_arg;
object_class->get_arg = gtk_old_editable_get_arg;
@ -370,6 +375,14 @@ gtk_old_editable_init (GtkOldEditable *old_editable)
targets, G_N_ELEMENTS (targets));
}
static void
gtk_old_editable_finalize (GObject *object)
{
gtk_selection_clear_targets (GTK_WIDGET (object), GDK_SELECTION_PRIMARY);
G_OBJECT_CLASS (gtk_old_editable_parent_class)->finalize (object);
}
static void
gtk_old_editable_insert_text (GtkEditable *editable,
const gchar *new_text,