[pulseaudio-discuss] [PATCH] bluetooth: Move stuff to pa_bluetooth_transport_put/unlink()

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Sun Oct 19 04:05:26 PDT 2014


On Tue, 2014-10-07 at 14:50 +0300, Tanu Kaskinen wrote:
> This should not have any effect on behaviour. The goal is to align
> with the pattern that I think we should follow:
> 
> Object initialization:
>  - put() is the place to create references from other objects to the
>    newly created object. In this case, adding the transport to
>    discovery->transports was moved from new() to put, and adding the
>    transport to device->transports was moved from set_state() to
>    put().
> 
> Object destruction:
>  - unlink() undoes put() and removes all references from other objects
>    to the object being unlinked. In this case setting the
>    device->transports pointer to NULL was moved from set_state() to
>    unlink(), and setting the discovery->transports pointer to NULL was
>    moved from free() to unlink().
>  - free() undoes new(), but also calls unlink() so that object owners
>    don't need to remember to call unlink() before free().
> ---
>  src/modules/bluetooth/backend-ofono.c |  3 ---
>  src/modules/bluetooth/bluez5-util.c   | 19 ++++++++++---------
>  2 files changed, 10 insertions(+), 12 deletions(-)

No feedback received, I pushed this now.

-- 
Tanu



More information about the pulseaudio-discuss mailing list