settings: cancel pending authorization requests if connection gets removed

Otherwise, the autorization request might succeed and we would
still do something with the connection that is already removed.

https://bugzilla.redhat.com/show_bug.cgi?id=1565030
This commit is contained in:
Thomas Haller 2018-04-09 17:35:20 +02:00
parent f0bddb44e0
commit 6ab0939e34

View file

@ -2276,11 +2276,19 @@ void
nm_settings_connection_signal_remove (NMSettingsConnection *self)
{
NMSettingsConnectionPrivate *priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self);
GSList *pending_auth;
if (priv->removed)
return;
priv->removed = TRUE;
while ((pending_auth = priv->pending_auths)) {
NMAuthChain *chain = pending_auth->data;
priv->pending_auths = g_slist_delete_link (priv->pending_auths, pending_auth);
nm_auth_chain_destroy (chain);
}
nm_dbus_object_emit_signal (NM_DBUS_OBJECT (self),
&interface_info_settings_connection,
&signal_info_removed,