summaryrefslogtreecommitdiff
path: root/gtk/gtkpathbar.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-01-19 11:57:10 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-01-19 11:57:10 -0500
commit63bc3542ce5cf5f9e711c8f4caad8a1ee1cf0cb0 (patch)
tree4d91150b9225bdd0ee1f0b187f88016692dbb7a0 /gtk/gtkpathbar.c
parentcb63fe042eec9dd46139fcd3a5e26da1849e20cd (diff)
downloadgtk+-63bc3542ce5cf5f9e711c8f4caad8a1ee1cf0cb0.tar.gz
path bar: Don't segfault if we get disposed quickly
The file chooser code now calls into the path bar in init, starting an async operation. This unveiled that the path bar code was not safe against being disposed early, by causing a crahsh of the objects-finalize test. Fix this by making the callback check for CANCELLED.
Diffstat (limited to 'gtk/gtkpathbar.c')
-rw-r--r--gtk/gtkpathbar.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 0afef8c8a3..06e11c8067 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -1791,6 +1791,9 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable,
const gchar *display_name;
gboolean is_hidden;
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ return;
+
if (cancellable != file_info->path_bar->priv->get_info_cancellable)
{
gtk_path_bar_set_file_finish (file_info, FALSE);
@@ -1876,6 +1879,7 @@ _gtk_path_bar_set_file (GtkPathBar *path_bar,
"standard::display-name,standard::is-hidden,standard::is-backup",
gtk_path_bar_get_info_callback,
info);
+
}
/* FIXME: This should be a construct-only property */