mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
hashmap: Add the ability to free keys
Since the hashmap stores a pointer to the key provided at pa_hashmap_put() time, it make sense to allow the hashmap to be given ownership of the key and have it free it at pa_hashmap_remove/free time. To do this cleanly, we now provide the key and value free functions at hashmap creation time with a pa_hashmap_new_full. With this, we do away with the free function that was provided at remove/free time for freeing the value.
This commit is contained in:
parent
317b46b571
commit
6825df8cec
41 changed files with 232 additions and 205 deletions
|
|
@ -5139,7 +5139,7 @@ void pa_native_protocol_unref(pa_native_protocol *p) {
|
|||
for (h = 0; h < PA_NATIVE_HOOK_MAX; h++)
|
||||
pa_hook_done(&p->hooks[h]);
|
||||
|
||||
pa_hashmap_free(p->extensions, NULL);
|
||||
pa_hashmap_free(p->extensions);
|
||||
|
||||
pa_assert_se(pa_shared_remove(p->core, "native-protocol") >= 0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue