monitor-config-store: Don't clear cancellable when cancelled

The cancellable should only be cleared if we weren't cancelled, as if
we were cancelled, the path cancelling have already cleared the
cancellable.

https://bugzilla.gnome.org/show_bug.cgi?id=787477
This commit is contained in:
Jonas Ådahl 2017-09-11 11:21:16 +08:00
parent 96572fbe6a
commit 5ed954e6de

View File

@ -1230,9 +1230,10 @@ saved_cb (GObject *object,
if (!g_file_replace_contents_finish (G_FILE (object), result, NULL, &error))
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Saving monitor configuration failed: %s\n", error->message);
else
g_clear_object (&data->config_store->save_cancellable);
{
g_warning ("Saving monitor configuration failed: %s\n", error->message);
g_clear_object (&data->config_store->save_cancellable);
}
g_error_free (error);
}