Commit dec0a687 authored by Cosimo Cecchi's avatar Cosimo Cecchi

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

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.

parent 7d02e326
......@@ -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,
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