[pulseaudio-discuss] [PATCH v1 4/8] bluetooth: Add reference counting to transports
tanuk at iki.fi
Thu Oct 18 10:46:51 PDT 2012
On Thu, 2012-10-18 at 10:27 +0200, Mikel Astiz wrote:
> From: Mikel Astiz <mikel.astiz at bmw-carit.de>
> module-bluetooth-device can benefit from having a reference counted
> transports objects, so it doesn't need to use functions like
> pa_bluetooth_discovery_get_transport() every time it needs to access
> this object.
I don't like reference counting much, because it makes the object life
cycle harder to understand, so I'd like to avoid it as much as possible.
I'm not sure how many agree with me here, though... Anyway, the solution
that I'd use would be to take advantage of the hook that you introduce
in the next patch. With that you can ensure that module-bluetooth-device
doesn't try to access a freed transport object, without having to rely
on the current approach of calling
pa_bluetooth_discovery_get_transport() all the time. What do you think?
More information about the pulseaudio-discuss