summaryrefslogtreecommitdiff
path: root/src/nm-manager.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-04-09 11:52:55 +0200
committerThomas Haller <thaller@redhat.com>2018-04-13 09:09:46 +0200
commit50b74731f668067d445a28d7e545a169bf9d25c8 (patch)
tree5e1e829c5acbf76d8292e06f99008be530eb0421 /src/nm-manager.c
parentbfaa291d89c02ee68780aa28eb7f19e1a925954f (diff)
downloadNetworkManager-50b74731f668067d445a28d7e545a169bf9d25c8.tar.gz
auth-chain/trivial: rename nm_auth_chain_unref() to nm_auth_chain_destroy()
NMAuthChain is not really ref-counted. True, we have an internal ref-counter to ensure that the instance stays alive while the callback is invoked. However, the user cannot take additional references as there is no nm_auth_chain_ref(). When the user wants to get rid of the auth-chain, with the current API it is important that the callback won't be called after that point. From the name nm_auth_chain_unref(), it sounds like that there could be multiple references to the auth-chain, and merely unreferencing the object might not guarantee that the callback is canceled. However, that is luckily not the case, because there is no real ref-counting involved here. Just rename the destroy function to make this clearer.
Diffstat (limited to 'src/nm-manager.c')
-rw-r--r--src/nm-manager.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index ed1aace333..612f41562c 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -953,7 +953,7 @@ _reload_auth_cb (NMAuthChain *chain,
g_dbus_method_invocation_return_value (context, NULL);
out:
- nm_auth_chain_unref (chain);
+ nm_auth_chain_destroy (chain);
}
static void
@@ -2100,7 +2100,7 @@ device_auth_done_cb (NMAuthChain *chain,
nm_auth_chain_get_data (chain, "user-data"));
g_clear_error (&error);
- nm_auth_chain_unref (chain);
+ nm_auth_chain_destroy (chain);
}
static void
@@ -4796,7 +4796,7 @@ deactivate_net_auth_done_cb (NMAuthChain *chain,
else
g_dbus_method_invocation_return_value (context, NULL);
- nm_auth_chain_unref (chain);
+ nm_auth_chain_destroy (chain);
}
static void
@@ -5138,7 +5138,7 @@ sleep_auth_done_cb (NMAuthChain *chain,
g_dbus_method_invocation_return_value (context, NULL);
}
- nm_auth_chain_unref (chain);
+ nm_auth_chain_destroy (chain);
}
#endif
@@ -5276,7 +5276,7 @@ enable_net_done_cb (NMAuthChain *chain,
g_dbus_method_invocation_take_error (context, ret_error);
}
- nm_auth_chain_unref (chain);
+ nm_auth_chain_destroy (chain);
}
static void
@@ -5384,7 +5384,7 @@ get_permissions_done_cb (NMAuthChain *chain,
g_variant_new ("(a{ss})", &results));
}
- nm_auth_chain_unref (chain);
+ nm_auth_chain_destroy (chain);
}
static void
@@ -5606,7 +5606,7 @@ check_connectivity_auth_done_cb (NMAuthChain *chain,
}
out:
- nm_auth_chain_unref (chain);
+ nm_auth_chain_destroy (chain);
}
static void
@@ -6017,7 +6017,7 @@ out:
g_dbus_method_invocation_return_dbus_error (invocation, error_name, error_message);
else
g_dbus_method_invocation_return_value (invocation, NULL);
- nm_auth_chain_unref (chain);
+ nm_auth_chain_destroy (chain);
}
void
@@ -6152,7 +6152,7 @@ checkpoint_auth_done_cb (NMAuthChain *chain,
else
g_dbus_method_invocation_return_value (context, variant);
- nm_auth_chain_unref (chain);
+ nm_auth_chain_destroy (chain);
}
static void
@@ -6830,7 +6830,7 @@ dispose (GObject *object)
g_slice_free (PlatformLinkCbData, data);
}
- g_slist_free_full (priv->auth_chains, (GDestroyNotify) nm_auth_chain_unref);
+ g_slist_free_full (priv->auth_chains, (GDestroyNotify) nm_auth_chain_destroy);
priv->auth_chains = NULL;
nm_clear_g_source (&priv->devices_inited_id);