[gtk+/gtk-2-24] Fixed gtk_recent_chooser_menu_set_current_filter to update the local pointer.
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] Fixed gtk_recent_chooser_menu_set_current_filter to update the local pointer.
- Date: Sat, 19 Feb 2011 15:02:49 +0000 (UTC)
commit 420f2fbddcbc19830cf70503ca1ca5c1f1b842db
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Sat Feb 5 00:58:40 2011 +0900
Fixed gtk_recent_chooser_menu_set_current_filter to update the local pointer.
Before this patch, unsetting the filter manually before disposing
the recent chooser menu (or unsetting the filter twice), would cause
warnings (or invalid memory accesses).
gtk/gtkrecentchoosermenu.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkrecentchoosermenu.c b/gtk/gtkrecentchoosermenu.c
index 1dd2ac2..68d54f9 100644
--- a/gtk/gtkrecentchoosermenu.c
+++ b/gtk/gtkrecentchoosermenu.c
@@ -711,11 +711,10 @@ gtk_recent_chooser_menu_set_current_filter (GtkRecentChooserMenu *menu,
if (priv->current_filter)
g_object_unref (G_OBJECT (priv->current_filter));
- if (filter)
- {
- priv->current_filter = filter;
- g_object_ref_sink (priv->current_filter);
- }
+ priv->current_filter = filter;
+
+ if (priv->current_filter)
+ g_object_ref_sink (priv->current_filter);
gtk_recent_chooser_menu_populate (menu);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]