Code Coverage Report for src/api/close.c
|
Hit |
Total |
Coverage |
Lines: |
10 |
10 |
100.0% |
Branches: |
54 |
54 |
100.0% |
1 /*
2 * libnogg: a decoder library for Ogg Vorbis streams
3 * Copyright (c) 2014-2024 Andrew Church <achurch@achurch.org>
4 *
5 * This software may be copied and redistributed under certain conditions;
6 * see the file "COPYING" in the source code distribution for details.
7 * NO WARRANTY is provided with this software.
8 */
9
10 #include "include/nogg.h"
11 #include "src/common.h"
12 #include "src/util/memory.h"
13
14 #include <stdlib.h>
15
16
17 void vorbis_close(vorbis_t *handle)
18 {
19 (18/18) if (!handle) {
20 return;
21 }
22
23 mem_free(handle, handle->decode_buf);
24 stb_vorbis_close(handle->decoder);
25 (18/18) if (handle->callbacks.close) {
26 (*handle->callbacks.close)(handle->callback_data);
27 }
28 (18/18) if (handle->callbacks.free) {
29 (*handle->callbacks.free)(handle->callback_data, handle);
30 } else {
31 free(handle);
32 }
33 }