mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
GDBus: Sink closures in _with_closures functions
See https://bugzilla.gnome.org/show_bug.cgi?id=621092#c12 Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
parent
8f5bde679e
commit
1ed105b19b
@ -737,13 +737,22 @@ g_bus_own_name_with_closures (GBusType bus_type,
|
||||
data = g_new0 (OwnNameData, 1);
|
||||
|
||||
if (bus_acquired_closure != NULL)
|
||||
data->bus_acquired_closure = g_closure_ref (bus_acquired_closure);
|
||||
{
|
||||
data->bus_acquired_closure = g_closure_ref (bus_acquired_closure);
|
||||
g_closure_sink (bus_acquired_closure);
|
||||
}
|
||||
|
||||
if (name_acquired_closure != NULL)
|
||||
data->name_acquired_closure = g_closure_ref (name_acquired_closure);
|
||||
{
|
||||
data->name_acquired_closure = g_closure_ref (name_acquired_closure);
|
||||
g_closure_sink (name_acquired_closure);
|
||||
}
|
||||
|
||||
if (name_lost_closure != NULL)
|
||||
data->name_lost_closure = g_closure_ref (name_lost_closure);
|
||||
{
|
||||
data->name_lost_closure = g_closure_ref (name_lost_closure);
|
||||
g_closure_sink (name_lost_closure);
|
||||
}
|
||||
|
||||
return g_bus_own_name (bus_type,
|
||||
name,
|
||||
@ -787,10 +796,16 @@ g_bus_own_name_on_connection_with_closures (GDBusConnection *connection
|
||||
data = g_new0 (OwnNameData, 1);
|
||||
|
||||
if (name_acquired_closure != NULL)
|
||||
data->name_acquired_closure = g_closure_ref (name_acquired_closure);
|
||||
{
|
||||
data->name_acquired_closure = g_closure_ref (name_acquired_closure);
|
||||
g_closure_sink (name_acquired_closure);
|
||||
}
|
||||
|
||||
if (name_lost_closure != NULL)
|
||||
data->name_lost_closure = g_closure_ref (name_lost_closure);
|
||||
{
|
||||
data->name_lost_closure = g_closure_ref (name_lost_closure);
|
||||
g_closure_sink (name_lost_closure);
|
||||
}
|
||||
|
||||
return g_bus_own_name_on_connection (connection,
|
||||
name,
|
||||
|
@ -739,10 +739,16 @@ g_bus_watch_name_with_closures (GBusType bus_type,
|
||||
data = g_new0 (WatchNameData, 1);
|
||||
|
||||
if (name_appeared_closure != NULL)
|
||||
data->name_appeared_closure = g_closure_ref (name_appeared_closure);
|
||||
{
|
||||
data->name_appeared_closure = g_closure_ref (name_appeared_closure);
|
||||
g_closure_sink (name_appeared_closure);
|
||||
}
|
||||
|
||||
if (name_vanished_closure != NULL)
|
||||
data->name_vanished_closure = g_closure_ref (name_vanished_closure);
|
||||
{
|
||||
data->name_vanished_closure = g_closure_ref (name_vanished_closure);
|
||||
g_closure_sink (name_vanished_closure);
|
||||
}
|
||||
|
||||
return g_bus_watch_name (bus_type,
|
||||
name,
|
||||
@ -785,10 +791,16 @@ guint g_bus_watch_name_on_connection_with_closures (
|
||||
data = g_new0 (WatchNameData, 1);
|
||||
|
||||
if (name_appeared_closure != NULL)
|
||||
data->name_appeared_closure = g_closure_ref (name_appeared_closure);
|
||||
{
|
||||
data->name_appeared_closure = g_closure_ref (name_appeared_closure);
|
||||
g_closure_sink (name_appeared_closure);
|
||||
}
|
||||
|
||||
if (name_vanished_closure != NULL)
|
||||
data->name_vanished_closure = g_closure_ref (name_vanished_closure);
|
||||
{
|
||||
data->name_vanished_closure = g_closure_ref (name_vanished_closure);
|
||||
g_closure_sink (name_vanished_closure);
|
||||
}
|
||||
|
||||
return g_bus_watch_name_on_connection (connection,
|
||||
name,
|
||||
|
Loading…
Reference in New Issue
Block a user