GDBusProxy: Make interface lookups O(1)

Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
David Zeuthen 2011-03-28 11:34:48 -04:00
parent 91f97ebbaa
commit b845c62c7f

View File

@ -166,7 +166,10 @@ g_dbus_proxy_finalize (GObject *object)
g_hash_table_unref (proxy->priv->properties);
if (proxy->priv->expected_interface != NULL)
g_dbus_interface_info_unref (proxy->priv->expected_interface);
{
g_dbus_interface_info_cache_release (proxy->priv->expected_interface);
g_dbus_interface_info_unref (proxy->priv->expected_interface);
}
G_OBJECT_CLASS (g_dbus_proxy_parent_class)->finalize (object);
}
@ -2093,8 +2096,13 @@ g_dbus_proxy_set_interface_info (GDBusProxy *proxy,
{
g_return_if_fail (G_IS_DBUS_PROXY (proxy));
if (proxy->priv->expected_interface != NULL)
g_dbus_interface_info_unref (proxy->priv->expected_interface);
{
g_dbus_interface_info_cache_release (proxy->priv->expected_interface);
g_dbus_interface_info_unref (proxy->priv->expected_interface);
}
proxy->priv->expected_interface = info != NULL ? g_dbus_interface_info_ref (info) : NULL;
if (proxy->priv->expected_interface != NULL)
g_dbus_interface_info_cache_build (proxy->priv->expected_interface);
}
/* ---------------------------------------------------------------------------------------------------- */