mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 09:50:09 +01:00
cloud-setup: simplify cancellation in _get_config_fetch_cancelled_cb()
If we call g_cancellable_connect() on a GCancellable that is already cancelled, then the callback is invoked synchronously. We need to handle that. However, we can slightly simplify the code. There is no change in behavior, but we can always let the cancelled callback return the result.
This commit is contained in:
parent
422ab25626
commit
be8a3f9902
1 changed files with 1 additions and 4 deletions
|
|
@ -268,9 +268,6 @@ _get_config_fetch_cancelled_cb(GObject *object, gpointer user_data)
|
|||
{
|
||||
GetConfigIfaceData *iface_data = user_data;
|
||||
|
||||
if (iface_data->cancelled_id == 0)
|
||||
return;
|
||||
|
||||
nm_clear_g_signal_handler(g_task_get_cancellable(iface_data->get_config_data->task),
|
||||
&iface_data->cancelled_id);
|
||||
_get_config_task_maybe_return(iface_data, nm_utils_error_new_cancelled(FALSE, NULL));
|
||||
|
|
@ -334,7 +331,7 @@ _get_config_metadata_ready_cb(GObject *source, GAsyncResult *result, gpointer us
|
|||
iface_data,
|
||||
NULL);
|
||||
if (cancelled_id == 0) {
|
||||
_get_config_task_maybe_return(iface_data, nm_utils_error_new_cancelled(FALSE, NULL));
|
||||
/* the callback was already invoked synchronously and the task already returned. */
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue