++2014-02-16 Daniel Colascione <dancol@dancol.org>
++
++ * dbusbind.c (xd_lisp_dbus_to_dbus): New function.
++ (xd_get_connection_address): Use it.
++ (xd_close_bus): Use xd_lisp_dbus_to_dbus to instead of
++ xd_get_connection_address because the latter signals if the bus
++ we're trying to close is already disconnected.
++
2014-02-13 Eli Zaretskii <eliz@gnu.org>
* w32proc.c (start_timer_thread): Pass a non-NULL pointer as last
return *refcount;
}
++/* Convert a Lisp dbus object to a pointer */
++static DBusConnection*
++xd_lisp_dbus_to_dbus (Lisp_Object bus)
++{
++ return (DBusConnection *) (intptr_t) XFASTINT (bus);
++}
++
/* Return D-Bus connection address. BUS is either a Lisp symbol,
:system or :session, or a string denoting the bus address. */
static DBusConnection *
if (NILP (val))
XD_SIGNAL2 (build_string ("No connection to bus"), bus);
else
-- connection = (DBusConnection *) (intptr_t) XFASTINT (val);
++ connection = xd_lisp_dbus_to_dbus (val);
if (!dbus_connection_get_is_connected (connection))
XD_SIGNAL2 (build_string ("No connection to bus"), bus);
{
DBusConnection *connection;
Lisp_Object val;
++ Lisp_Object busobj;
/* Check whether we are connected. */
val = Fassoc (bus, xd_registered_buses);
if (NILP (val))
return;
++ busobj = CDR_SAFE(val);
++ if (NILP (val)) {
++ xd_registered_buses = Fdelete (val, xd_registered_buses);
++ return;
++ }
++
/* Retrieve bus address. */
-- connection = xd_get_connection_address (bus);
++ connection = xd_lisp_dbus_to_dbus (busobj);
if (xd_get_connection_references (connection) == 1)
{