mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
topology: Define a free handler for the element
This handler is defined for type-specific destruction of an element. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
374c5fa9c5
commit
6b31bf8edb
2 changed files with 7 additions and 1 deletions
|
|
@ -83,8 +83,12 @@ void tplg_elem_free(struct tplg_elem *elem)
|
|||
/* free struct snd_tplg_ object,
|
||||
* the union pointers share the same address
|
||||
*/
|
||||
if (elem->obj)
|
||||
if (elem->obj) {
|
||||
if (elem->free)
|
||||
elem->free(elem->obj);
|
||||
|
||||
free(elem->obj);
|
||||
}
|
||||
|
||||
free(elem);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue