From 9a50f5f8b10711f32990a77477cd828be5589a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Sun, 3 Sep 2017 10:30:01 -0300 Subject: [PATCH] (file_list.c) Document file_list_free() behavior --- libretro-common/include/lists/file_list.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libretro-common/include/lists/file_list.h b/libretro-common/include/lists/file_list.h index 95b0eb5d2c..67d3875fc9 100644 --- a/libretro-common/include/lists/file_list.h +++ b/libretro-common/include/lists/file_list.h @@ -59,6 +59,16 @@ void *file_list_get_userdata_at_offset(const file_list_t *list, void *file_list_get_actiondata_at_offset(const file_list_t *list, size_t index); +/** + * @brief frees the list + * + * NOTE: This function will also free() the entries actiondata + * and userdata fields if they are non-null. If you store complex + * or non-contiguous data there, make sure you free it's fields + * before calling this function or you might get a memory leak. + * + * @param list + */ void file_list_free(file_list_t *list); bool file_list_append(file_list_t *userdata, const char *path,