Line data Source code
1 : /*
2 : * Copyright © 2016 Mozilla Foundation
3 : *
4 : * This program is made available under an ISC-style license. See the
5 : * accompanying file LICENSE for details.
6 : */
7 :
8 : #include "cubeb_utils.h"
9 : #include "cubeb_assert.h"
10 :
11 : #include <stdlib.h>
12 :
13 : static void
14 0 : device_info_destroy(cubeb_device_info * info)
15 : {
16 0 : XASSERT(info);
17 :
18 0 : free((void *) info->device_id);
19 0 : free((void *) info->friendly_name);
20 0 : free((void *) info->group_id);
21 0 : free((void *) info->vendor_name);
22 0 : }
23 :
24 : int
25 0 : cubeb_utils_default_device_collection_destroy(cubeb * context,
26 : cubeb_device_collection * collection)
27 : {
28 : uint32_t i;
29 0 : XASSERT(collection);
30 :
31 : (void) context;
32 :
33 0 : for (i = 0; i < collection->count; i++)
34 0 : device_info_destroy(&collection->device[i]);
35 :
36 0 : free(collection->device);
37 0 : return CUBEB_OK;
38 : }
|