mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-04 23:28:05 +02:00
2003-03-16 Havoc Pennington <hp@pobox.com>
* dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
This commit is contained in:
parent
0e298fbeb5
commit
15f02e1071
4 changed files with 18 additions and 8 deletions
|
|
@ -1,3 +1,7 @@
|
|||
2003-03-16 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
|
||||
|
||||
2003-03-17 Anders Carlsson <andersca@codefactory.se>
|
||||
|
||||
* bus/activation.c (bus_activation_activate_service): Append
|
||||
|
|
|
|||
|
|
@ -980,7 +980,7 @@ bus_dispatch_test (const DBusString *test_data_dir)
|
|||
|
||||
check1_try_iterations (context, "create_and_hello",
|
||||
check_hello_connection);
|
||||
|
||||
|
||||
dbus_connection_disconnect (foo);
|
||||
if (bus_connection_dispatch_one_message (foo))
|
||||
_dbus_assert_not_reached ("extra message in queue");
|
||||
|
|
|
|||
|
|
@ -82,13 +82,17 @@ data_slot_ref (void)
|
|||
{
|
||||
dbus_mutex_lock (slot_lock);
|
||||
|
||||
if (bus_data_slot < 0)
|
||||
bus_data_slot = dbus_connection_allocate_data_slot ();
|
||||
|
||||
if (bus_data_slot < 0)
|
||||
{
|
||||
dbus_mutex_unlock (slot_lock);
|
||||
return FALSE;
|
||||
bus_data_slot = dbus_connection_allocate_data_slot ();
|
||||
|
||||
if (bus_data_slot < 0)
|
||||
{
|
||||
dbus_mutex_unlock (slot_lock);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
_dbus_assert (bus_data_slot_refcount == 0);
|
||||
}
|
||||
|
||||
bus_data_slot_refcount += 1;
|
||||
|
|
@ -103,8 +107,8 @@ data_slot_unref (void)
|
|||
{
|
||||
dbus_mutex_lock (slot_lock);
|
||||
|
||||
_dbus_assert (bus_data_slot >= 0);
|
||||
_dbus_assert (bus_data_slot_refcount > 0);
|
||||
_dbus_assert (bus_data_slot >= 0);
|
||||
|
||||
bus_data_slot_refcount -= 1;
|
||||
|
||||
|
|
@ -149,7 +153,7 @@ ensure_bus_data (DBusConnection *connection)
|
|||
if (!dbus_connection_set_data (connection, bus_data_slot, bd,
|
||||
bus_data_free))
|
||||
{
|
||||
bus_data_free (bd);
|
||||
dbus_free (bd);
|
||||
data_slot_unref ();
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -866,6 +866,8 @@ _dbus_connection_last_unref (DBusConnection *connection)
|
|||
DBusHashIter iter;
|
||||
DBusList *link;
|
||||
|
||||
_dbus_assert (connection->refcount == 0);
|
||||
|
||||
/* You have to disconnect the connection before unref:ing it. Otherwise
|
||||
* you won't get the disconnected message.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue