[gtk+] Fixed gtk_recent_chooser_menu_set_current_filter to update the local pointer.



commit 012bc98936c9e179117392d248d1445c42fd54d6
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 9e37703..4d61ad1 100644
--- a/gtk/gtkrecentchoosermenu.c
+++ b/gtk/gtkrecentchoosermenu.c
@@ -731,11 +731,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]