Commit 77d5cd31 authored by vitor's avatar vitor

Implement av_tree_destroy_free_elem() to destroy a tree and free all the

values stored on it.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22119 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a54a89f4
......@@ -135,6 +135,15 @@ void av_tree_destroy(AVTreeNode *t){
}
}
void av_tree_destroy_free_elem(AVTreeNode *t){
if(t){
av_tree_destroy_free_elem(t->child[0]);
av_tree_destroy_free_elem(t->child[1]);
av_free(t->elem);
av_free(t);
}
}
#if 0
void av_tree_enumerate(AVTreeNode *t, void *opaque, int (*cmp)(void *opaque, void *elem), int (*enu)(void *opaque, void *elem)){
if(t){
......
......@@ -78,5 +78,6 @@ void *av_tree_find(const struct AVTreeNode *root, void *key, int (*cmp)(void *ke
*/
void *av_tree_insert(struct AVTreeNode **rootp, void *key, int (*cmp)(void *key, const void *b), struct AVTreeNode **next);
void av_tree_destroy(struct AVTreeNode *t);
void av_tree_destroy_free_elem(struct AVTreeNode *t);
#endif /* AVUTIL_TREE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment