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).
This commit is contained in:
Tristan Van Berkom 2011-02-05 00:58:40 +09:00 committed by Matthias Clasen
parent 45d05f52c2
commit 420f2fbddc

View File

@ -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);