mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-19 11:18:28 +02:00
clients/secret-agent: use nm-utils error reason for callback while disposing NMSecretAgentSimple
No caller cared about the NM_SECRET_AGENT_ERROR_AGENT_CANCELED reason. In particular, because previously the requests would keep the secret-agent instance alive, and this never happend. Also, NM_SECRET_AGENT_ERROR_AGENT_CANCELED precicley exists for NMSecretAgentOld:cancel_get_secrets() (as documented). During finalize we are not cancelled -- at least not the same way as cancel_get_secrets(). Setting NM_SECRET_AGENT_ERROR_AGENT_CANCELED is wrong. Anyway, we have a default error for such cases already.
This commit is contained in:
parent
d68bdce206
commit
82472c557c
1 changed files with 4 additions and 7 deletions
|
|
@ -1135,15 +1135,12 @@ dispose (GObject *object)
|
|||
|
||||
g_hash_table_iter_init (&iter, priv->requests);
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &request)) {
|
||||
if (!error) {
|
||||
g_set_error (&error,
|
||||
NM_SECRET_AGENT_ERROR,
|
||||
NM_SECRET_AGENT_ERROR_AGENT_CANCELED,
|
||||
"The secret agent is going away");
|
||||
}
|
||||
if (!error)
|
||||
nm_utils_error_set_cancelled (&error, TRUE, "NMSecretAgentSimple");
|
||||
request->callback (NM_SECRET_AGENT_OLD (object),
|
||||
request->connection,
|
||||
NULL, error,
|
||||
NULL,
|
||||
error,
|
||||
request->callback_data);
|
||||
g_hash_table_iter_remove (&iter);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue