diff options
author | Federico Mena Quintero <federico@gnome.org> | 2011-04-01 16:06:51 -0600 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2011-04-01 17:00:17 -0600 |
commit | 58609cfdaf4f4772aaa57b7a03d1d150da59b853 (patch) | |
tree | 12fd09b416657d124060015fe11f5af265baf798 /gtk/gtkfilechooserbutton.c | |
parent | a24f61fb3763c71eccbe4e34efd79e5e19ca1414 (diff) | |
download | gtk+-58609cfdaf4f4772aaa57b7a03d1d150da59b853.tar.gz |
[filechooser] Unref cancellables we got from the model, not the ones that come into the callback
The model_cancellables have an extra ref when we get them from gtk_tree_model_get().
So, we need to unref them always. On the other hand, the cancellables that get
passed as arguments to the callbacks in question are memory-managed by
GtkFileSystemModel.
Reported by Morten Welinder <mortenw@gnome.org>
https://bugzilla.gnome.org/show_bug.cgi?id=646460
Diffstat (limited to 'gtk/gtkfilechooserbutton.c')
-rw-r--r-- | gtk/gtkfilechooserbutton.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index 43da440632..8b917fb303 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -1399,7 +1399,7 @@ set_info_get_info_cb (GCancellable *cancellable, GdkPixbuf *pixbuf; GtkTreePath *path; GtkTreeIter iter; - GCancellable *model_cancellable; + GCancellable *model_cancellable = NULL; struct SetDisplayNameData *data = callback_data; gboolean is_folder; @@ -1452,7 +1452,8 @@ out: gtk_tree_row_reference_free (data->row_ref); g_free (data); - g_object_unref (cancellable); + if (model_cancellable) + g_object_unref (model_cancellable); } static void @@ -1578,7 +1579,7 @@ model_add_special_get_info_cb (GCancellable *cancellable, GtkTreeIter iter; GtkTreePath *path; GdkPixbuf *pixbuf; - GCancellable *model_cancellable; + GCancellable *model_cancellable = NULL; struct ChangeIconThemeData *data = user_data; gchar *name; @@ -1631,7 +1632,8 @@ out: gtk_tree_row_reference_free (data->row_ref); g_free (data); - g_object_unref (cancellable); + if (model_cancellable) + g_object_unref (model_cancellable); } static inline void |