Commit 45c24fb9 authored by Thomas Haller's avatar Thomas Haller

checkpoint/trivial: rename nm_checkpoint_manager_unref() to nm_checkpoint_manager_free()

NMCheckpointManager was added and is not ref-countable, because it
is not needed.

I still often like for such objects (that are not ref-countable),
that their destroy function is called "unref". Both for consistency,
and also if we would later add ref-counting to the object.

However, NMCheckpointManager keeps a pointer to NMManager. So, when
NMManager gets destroyed, it *MUST* destroy the NMCheckpointManager.
It cannot accept that the checkpoint manager outlives NMManager,
but the "unref" name suggests that somebody else might have still
a reference to this object keeping it alive. That is not the case.

Rename so that this is clear.

I would name it nm_checkpoint_manager_destroy(), but "destroy" already
has a meaning for NMCheckpoint instances, so use "free".
parent ffb49267
......@@ -346,7 +346,7 @@ nm_checkpoint_manager_new (NMManager *manager, GParamSpec *spec)
}
void
nm_checkpoint_manager_unref (NMCheckpointManager *self)
nm_checkpoint_manager_free (NMCheckpointManager *self)
{
if (!self)
return;
......
......@@ -28,7 +28,8 @@
typedef struct _NMCheckpointManager NMCheckpointManager;
NMCheckpointManager *nm_checkpoint_manager_new (NMManager *manager, GParamSpec *spec);
void nm_checkpoint_manager_unref (NMCheckpointManager *self);
void nm_checkpoint_manager_free (NMCheckpointManager *self);
NMCheckpoint *nm_checkpoint_manager_create (NMCheckpointManager *self,
const char *const*device_names,
......
......@@ -6666,7 +6666,7 @@ dispose (GObject *object)
if (priv->checkpoint_mgr) {
nm_checkpoint_manager_destroy_all (priv->checkpoint_mgr, NULL);
g_clear_pointer (&priv->checkpoint_mgr, nm_checkpoint_manager_unref);
g_clear_pointer (&priv->checkpoint_mgr, nm_checkpoint_manager_free);
}
if (priv->auth_mgr) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment