mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
gdbusproxy: only connect to NameOwnerChanged for message buses
Names are a message bus feature, so it does not make sense to connect to NameOwnerChanged when the underlying connection is not a message bus. Moreover, g_dbus_connection_signal_subscribe() will also enforce that condition. Adding this extra check here is helpful to avoid a critical warning when using GDBusProxy with peer-to-peer connections. https://gitlab.gnome.org/GNOME/glib/issues/1620
This commit is contained in:
parent
7d02e32644
commit
dec0a6874e
@ -1768,7 +1768,8 @@ async_initable_init_first (GAsyncInitable *initable)
|
||||
(GDestroyNotify) signal_subscription_unref);
|
||||
}
|
||||
|
||||
if (proxy->priv->name != NULL)
|
||||
if (proxy->priv->name != NULL &&
|
||||
(g_dbus_connection_get_flags (proxy->priv->connection) & G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION))
|
||||
{
|
||||
proxy->priv->name_owner_changed_subscription_id =
|
||||
g_dbus_connection_signal_subscribe (proxy->priv->connection,
|
||||
|
Loading…
Reference in New Issue
Block a user