[systemd-devel] refcount of bus returned from sd_bus_default_system
angelovic.s at gmail.com
Wed May 8 20:50:12 UTC 2019
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 leaks.
Now it broke, however, because in systemd v242, the initial ref count is 1.
Is that a conscious change? Can we build upon the guarantee that it will
always be 1? (1 actually seems reasonable, unlike 2).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the systemd-devel