Commit 0c12d3af authored by Ross Lagerwall's avatar Ross Lagerwall

GtkPlacesSidebar: Don't update bookmark if cancelled

If the query fails because it has been cancelled, it means that
dispose() has been called, so don't try and update anything.

This fixes a segfault with Nautilus in certain situations.
parent 94ed54f8
......@@ -838,13 +838,16 @@ on_bookmark_query_info_complete (GObject *source,
BookmarkQueryClosure *clos = data;
GtkPlacesSidebar *sidebar = clos->sidebar;
GFile *root = G_FILE (source);
GError *error = NULL;
GFileInfo *info;
gchar *bookmark_name;
gchar *mount_uri;
gchar *tooltip;
GIcon *icon;
info = g_file_query_info_finish (root, result, NULL);
info = g_file_query_info_finish (root, result, &error);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
goto out;
bookmark_name = _gtk_bookmarks_manager_get_bookmark_label (sidebar->bookmarks_manager, root);
if (bookmark_name == NULL && info != NULL)
......@@ -880,6 +883,7 @@ on_bookmark_query_info_complete (GObject *source,
g_clear_object (&info);
g_clear_error (&error);
g_slice_free (BookmarkQueryClosure, clos);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment