[PATCH v5 09/39] bluetooth: Create a function to remove only one adapter object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2013-09-24 at 19:45 -0300, jprvita at gmail.com wrote:
> @@ -371,11 +398,8 @@ static void adapter_remove_all(pa_bluetooth_discovery *y) {
>  
>      /* When this function is called all devices have already been freed */
>  
> -    while ((a = pa_hashmap_steal_first(y->adapters))) {
> -        pa_xfree(a->path);
> -        pa_xfree(a->address);
> -        pa_xfree(a);
> -    }
> +    while ((a = pa_hashmap_steal_first(y->adapters)))
> +        adapter_free(a);

pa_hashmap_remove_all() can be used here (the hashmap initialization
needs to be changed so that adapter_free is passed to
pa_hashmap_new_full()). Actually, the whole adapter_remove_all()
function is now redundant, because it's effectively just an alias for
pa_hashmap_remove_all().

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux