chiark / gitweb /
bus: drop bus/message GC logic
authorLennart Poettering <lennart@poettering.net>
Wed, 2 Jul 2014 15:29:09 +0000 (17:29 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 2 Jul 2014 15:29:09 +0000 (17:29 +0200)
commitb5eca3a2059f9399d1dc52cbcf9698674c4b1cf0
tree24070107582a0b0e3b777a529dadde85b07f6d7a
parent62bb05f64fe4d7aeadffb4815ba6a9082b1da285
bus: drop bus/message GC logic

When a caller drops all references to a bus and its messages while the
messages where still queue, this causes the bus to reference the
messages, and the messages to reference the bus, without anybody else
keeping a reference, which is something we so far considered a leak, and
tried to fix with a GC logic that would recognize cases like this, and
drop the reference.

This GC logic has been broken sofar, and remained unfixed. This commit
removes it altogther, replacing it with nothing. The rationale is that
simply because all refs to the bus have been dropped its queued messages
should *still* be written to the bus, even if the caller doesn't retain
any reference to either bus nor message. This means it was actually
wrong to attempt to clean up the bus in this case.

The proper way how applications should handle this is by explicitly
invoking sd_bus_close(), when they want busses to go away. This is
probably want they want to do anyway to avoid getting spurious
callbacks after they stopped using a bus.
src/libsystemd/sd-bus/bus-message.c
src/libsystemd/sd-bus/sd-bus.c