[systemd-devel] [RFC][PATCH] sd-dhcp-client: return NULL from _unref() like the other sd-* libraries

Tom Gundersen teg at jklm.no
Sat May 24 02:11:17 PDT 2014


On Sat, May 24, 2014 at 2:58 AM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Thu, 22.05.14 15:29, Tom Gundersen (teg at jklm.no) wrote:
>
>> Let's keep this behavior consistent across our libraries.
>>
>> In order to keep the refcounting working, a DONT_DESTROY macro similar
>> to the one in sd-bus was introduced.
>
> The DON_DESTROY stuff you only really need when you dispatch some
> calback from a function call. It's there to make sure that the callback
> can drop the final ref for the object, but you can still access the
> object after it finished. There's no point in placing the macro in all
> functions, that's entirely unnecessary.


I (intended to) place it in all functions that may indirectly dispatch
a callback (even though it is deep down in the call chain).

-t


More information about the systemd-devel mailing list