From 4174446a6ddc36a1256be14ed6b337b96b34f968 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 6 Dec 2005 18:03:50 +0000 Subject: [PATCH] Fix refcounting issues with new_event and its window. 2005-12-06 Matthias Clasen * gtk/gtktreeview.c (gtk_tree_view_key_press): Fix refcounting issues with new_event and its window. --- ChangeLog | 3 +++ ChangeLog.pre-2-10 | 3 +++ gtk/gtktreeview.c | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8091dc9816..5931b5ad2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-12-06 Matthias Clasen + * gtk/gtktreeview.c (gtk_tree_view_key_press): Fix refcounting + issues with new_event and its window. + * gtk/gtkmenu.c (gtk_menu_attach_to_widget): Accept NULL as a detach func. (#323386, Jorn Baayen) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8091dc9816..5931b5ad2d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2005-12-06 Matthias Clasen + * gtk/gtktreeview.c (gtk_tree_view_key_press): Fix refcounting + issues with new_event and its window. + * gtk/gtkmenu.c (gtk_menu_attach_to_widget): Accept NULL as a detach func. (#323386, Jorn Baayen) diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 71cd603f0b..5a2f2d04f1 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -4447,7 +4447,8 @@ gtk_tree_view_key_press (GtkWidget *widget, /* Make a copy of the current text */ old_text = g_strdup (gtk_entry_get_text (GTK_ENTRY (tree_view->priv->search_entry))); new_event = gdk_event_copy ((GdkEvent *) event); - ((GdkEventKey *) new_event)->window = tree_view->priv->search_entry->window; + g_object_unref (((GdkEventKey *) new_event)->window); + ((GdkEventKey *) new_event)->window = g_object_ref (tree_view->priv->search_entry->window); gtk_widget_realize (tree_view->priv->search_window); popup_menu_id = g_signal_connect (tree_view->priv->search_entry,