diff options
author | Carlos Soriano <csoriano@gnome.org> | 2015-09-04 21:50:19 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2015-09-04 23:03:45 +0200 |
commit | 4bba25351cef3ca33e30c9c3e7a8fcd8ffbac798 (patch) | |
tree | ed6b339d82d2d1e2c029434119d5d740d9303f4e /src/gtk | |
parent | 8754395da6d3454f0f29149627e661c7a93fd19c (diff) | |
download | nautilus-4bba25351cef3ca33e30c9c3e7a8fcd8ffbac798.tar.gz |
gtkplacesview: avoid accesing private structure if finalize
We were accesing the private structure on a async callback,
which can be cancelled on finalize and therefore accesing the
private structure would be invalid, causing a crash.
Diffstat (limited to 'src/gtk')
-rw-r--r-- | src/gtk/gtkplacesview.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gtk/gtkplacesview.c b/src/gtk/gtkplacesview.c index af2c5cd49..da5c19f10 100644 --- a/src/gtk/gtkplacesview.c +++ b/src/gtk/gtkplacesview.c @@ -990,23 +990,22 @@ network_enumeration_finished (GObject *source_object, { GtkPlacesViewPrivate *priv; GFileEnumerator *enumerator; - GtkPlacesView *view; GError *error; - view = GTK_PLACES_VIEW (user_data); - priv = gtk_places_view_get_instance_private (view); error = NULL; enumerator = g_file_enumerate_children_finish (G_FILE (source_object), res, &error); if (error) { - if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && + !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED)) g_warning ("Failed to fetch network locations: %s", error->message); g_clear_error (&error); } else { + priv = gtk_places_view_get_instance_private (GTK_PLACES_VIEW (user_data)); g_file_enumerator_next_files_async (enumerator, G_MAXINT32, G_PRIORITY_DEFAULT, |