mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 04:56:14 +01:00
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:
parent
d4ed690120
commit
04a4da8065
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user