1
0
mirror of https://gitlab.gnome.org/GNOME/nautilus synced 2024-06-30 23:46:35 +00:00

internal-place-file: Really don't access self pointer after destruction

We've avoided the trivial case of cancellation on destruction, as part of 
commit 16b81477b3 

But there may be cases where the async task returns an error even before it's cancelled,
but the async callback is only called in a future iteration where the file is already 
destroyed. So, handle that case too and add a warning while at it.

(cherry picked from commit 7d80a9ad82)
This commit is contained in:
António Fernandes 2024-06-10 19:32:33 +00:00 committed by Peter Eisenmann
parent da4dd182a1
commit 746f9c4247

View File

@ -53,9 +53,12 @@ network_mount_callback (GObject *source_object,
{
g_autoptr (GError) error = NULL;
(void) g_file_mount_enclosing_volume_finish (G_FILE (source_object), result, &error);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
if (!g_file_mount_enclosing_volume_finish (G_FILE (source_object), result, &error))
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
{
g_warning ("Could not mount '%s': %s", SCHEME_NETWORK ":///", error->message);
}
return;
}