Re: [systemd-devel] refcount of bus returned from sd_bus_default_system

2019-05-09 Thread Stanislav Angelovič
Thank you Lennart for detailed explanation. I realized a few things in sd-bus behavior (and in my wrong approach to default bus -- yes I forgot about hello message) when I debugged the thing earlier today, and now your explanation cleared that up pretty nicely to me. I see again that sd-bus design

Re: [systemd-devel] refcount of bus returned from sd_bus_default_system

2019-05-09 Thread Lennart Poettering
On Mi, 08.05.19 22:50, Stanislav Angelovič (angelovi...@gmail.com) wrote: > Heya, > > when writing sdbus-c++, we've observed that sd_bus_default_system function > called in a fresh new thread returns a bus with initial ref count 2. We > built our code upon that assumption -- we had to unref the bu

[systemd-devel] refcount of bus returned from sd_bus_default_system

2019-05-08 Thread Stanislav Angelovič
Heya, when writing sdbus-c++, we've observed that sd_bus_default_system function called in a fresh new thread returns a bus with initial ref count 2. We built our code upon that assumption -- we had to unref the bus twice when the thread local storage got freed, otherwise we'd have gotten memory l