From bf07fc88a330061c59186bf4a11218b5d51aec6f Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sun, 16 Feb 2003 12:57:26 +0000 Subject: 2003-02-16 Anders Carlsson * dbus/dbus-auth.c: (client_try_next_mechanism): Plug a leak. * dbus/dbus-threads.c: (dbus_condvar_wait_timeout): Return TRUE if there's no thread implementation around. * glib/dbus-gmain.c: (free_source), (dbus_connection_hookup_with_g_main): Make sure to remove the GSource when the connection is finalized. --- ChangeLog | 12 ++++++++++++ dbus/dbus-auth.c | 2 ++ dbus/dbus-threads.c | 2 +- glib/dbus-gmain.c | 15 +++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 662ce240..ec0bb118 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2003-02-16 Anders Carlsson + + * dbus/dbus-auth.c: (client_try_next_mechanism): + Plug a leak. + + * dbus/dbus-threads.c: (dbus_condvar_wait_timeout): + Return TRUE if there's no thread implementation around. + + * glib/dbus-gmain.c: (free_source), + (dbus_connection_hookup_with_g_main): + Make sure to remove the GSource when the connection is finalized. + 2003-02-16 Anders Carlsson * bus/dispatch.c: (bus_dispatch_message_handler): diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c index 8125a8ed..dca83ba3 100644 --- a/dbus/dbus-auth.c +++ b/dbus/dbus-auth.c @@ -939,6 +939,8 @@ client_try_next_mechanism (DBusAuth *auth) _dbus_verbose ("Trying mechanism %s\n", auth->mech->mechanism); + _dbus_string_free (&auth_command); + return TRUE; } diff --git a/dbus/dbus-threads.c b/dbus/dbus-threads.c index 4df2e34c..0b392240 100644 --- a/dbus/dbus-threads.c +++ b/dbus/dbus-threads.c @@ -166,7 +166,7 @@ dbus_condvar_wait_timeout (DBusCondVar *cond, if (cond && mutex && thread_functions.condvar_wait) return (* thread_functions.condvar_wait_timeout) (cond, mutex, timeout_milliseconds); else - return FALSE; + return TRUE; } /** diff --git a/glib/dbus-gmain.c b/glib/dbus-gmain.c index 857ee37e..f8355a3f 100644 --- a/glib/dbus-gmain.c +++ b/glib/dbus-gmain.c @@ -36,6 +36,8 @@ struct _DBusGSource GHashTable *watches; }; +static int connection_slot = -1; + static gboolean dbus_connection_prepare (GSource *source, gint *timeout); static gboolean dbus_connection_check (GSource *source); @@ -206,6 +208,12 @@ remove_timeout (DBusTimeout *timeout, g_source_remove (timeout_tag); } +static void +free_source (GSource *source) +{ + g_source_destroy (source); +} + void dbus_connection_hookup_with_g_main (DBusConnection *connection) { @@ -228,4 +236,11 @@ dbus_connection_hookup_with_g_main (DBusConnection *connection) NULL, NULL); g_source_attach (source, NULL); + + if (connection_slot == -1 ) + connection_slot = dbus_connection_allocate_data_slot (); + + dbus_connection_set_data (connection, connection_slot, source, + (DBusFreeFunction)free_source); + } -- cgit