diff options
author | Adrian Szyndela <adrian.s@samsung.com> | 2015-05-05 12:27:15 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2015-05-05 12:27:15 +0100 |
commit | bebe9ca9937a5e44147c8fc0160f04d39573d110 (patch) | |
tree | 0067eb67c407a7cf62cd52d16e15f0c74c1c8395 | |
parent | 08e2b810622096e84e9c9099450bfadf5768e97e (diff) |
extend lock's range in live_messages_notify()
The other code paths that ref or unref a transport are protected by
the DBusConnection's lock. This function already used that lock,
but for a narrower scope than the refcount manipulation.
live_messages_notify() could be triggered by unreffing messages
that originated from the same connection in a different thread.
[smcv: added commit message]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90312
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r-- | dbus/dbus-transport.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c index f63e0ced..e9dcc568 100644 --- a/dbus/dbus-transport.c +++ b/dbus/dbus-transport.c @@ -63,6 +63,7 @@ live_messages_notify (DBusCounter *counter, { DBusTransport *transport = user_data; + _dbus_connection_lock (transport->connection); _dbus_transport_ref (transport); #if 0 @@ -77,12 +78,11 @@ live_messages_notify (DBusCounter *counter, */ if (transport->vtable->live_messages_changed) { - _dbus_connection_lock (transport->connection); (* transport->vtable->live_messages_changed) (transport); - _dbus_connection_unlock (transport->connection); } _dbus_transport_unref (transport); + _dbus_connection_unlock (transport->connection); } /** |