gdbusobjectmanagerclient: Move weak ref helpers upwards

This allows it to be used in on_notify_g_name_owner() as well

Signed-off-by: Guido Günther <agx@sigxcpu.org>
This commit is contained in:
Guido Günther 2021-05-26 21:14:39 +02:00
parent d4ed690120
commit 04a4da8065

View File

@ -1244,6 +1244,21 @@ maybe_unsubscribe_signals (GDBusObjectManagerClient *manager)
/* ---------------------------------------------------------------------------------------------------- */
static GWeakRef *
weak_ref_new (GObject *object)
{
GWeakRef *weak_ref = g_new0 (GWeakRef, 1);
g_weak_ref_init (weak_ref, object);
return g_steal_pointer (&weak_ref);
}
static void
weak_ref_free (GWeakRef *weak_ref)
{
g_weak_ref_clear (weak_ref);
g_free (weak_ref);
}
static void
on_notify_g_name_owner (GObject *object,
GParamSpec *pspec,
@ -1342,21 +1357,6 @@ on_notify_g_name_owner (GObject *object,
g_object_unref (manager);
}
static GWeakRef *
weak_ref_new (GObject *object)
{
GWeakRef *weak_ref = g_new0 (GWeakRef, 1);
g_weak_ref_init (weak_ref, object);
return g_steal_pointer (&weak_ref);
}
static void
weak_ref_free (GWeakRef *weak_ref)
{
g_weak_ref_clear (weak_ref);
g_free (weak_ref);
}
static gboolean
initable_init (GInitable *initable,
GCancellable *cancellable,