diff options
-rw-r--r-- | src/directory.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/directory.c b/src/directory.c index ba1ae8560..ccf2be7a4 100644 --- a/src/directory.c +++ b/src/directory.c @@ -17,6 +17,7 @@ */ #include "directory.h" +#include "song.h" #include "utils.h" #include "path.h" @@ -44,6 +45,12 @@ directory_new(const char *path, struct directory *parent) void directory_free(struct directory *directory) { + for (unsigned i = 0; i < directory->songs.nr; ++i) + song_free(directory->songs.base[i]); + + for (unsigned i = 0; i < directory->children.nr; ++i) + directory_free(directory->children.base[i]); + dirvec_destroy(&directory->children); songvec_destroy(&directory->songs); free(directory); |