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>
/* 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);
}
*/
struct list_head ref_list;
struct list_head list; /* list of all elements with same type */
+
+ void (*free)(void *obj);
};
struct map_elem {