sd-bus: unref slot->match_callback.install_slot when slot is disconnected
When a slot is disconnected, then slot->match_callback.install_slot is also disconnected. So, bus_slot_disconnect() removes the install_slot from the list of slots in bus, although it is a floating object. This makes install_slot unreffed from bus when it is disconnected. Fixes #9505 and #9510.
This commit is contained in:
parent
8840c47c0d
commit
20d4ee2cbc
|
@ -79,7 +79,10 @@ void bus_slot_disconnect(sd_bus_slot *slot) {
|
|||
(void) bus_remove_match_internal(slot->bus, slot->match_callback.match_string);
|
||||
|
||||
if (slot->match_callback.install_slot) {
|
||||
bus_slot_disconnect(slot->match_callback.install_slot);
|
||||
if (slot->match_callback.install_slot->bus) {
|
||||
bus_slot_disconnect(slot->match_callback.install_slot);
|
||||
sd_bus_slot_unref(slot->match_callback.install_slot);
|
||||
}
|
||||
slot->match_callback.install_slot = sd_bus_slot_unref(slot->match_callback.install_slot);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue