diff options
| author | Ray <[email protected]> | 2022-11-22 17:09:39 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-11-22 17:09:39 +0100 |
| commit | c0010105c258096d190536c9043e67be18164413 (patch) | |
| tree | 1e55162002eea78f6d2cf524d65f24d914377e7f /src | |
| parent | f6558fe6e0932863b83d2a6a49b8fc81b7354242 (diff) | |
| download | raylib-c0010105c258096d190536c9043e67be18164413.tar.gz raylib-c0010105c258096d190536c9043e67be18164413.zip | |
REVIEWED: UnloadDirectoryFiles()
Diffstat (limited to 'src')
| -rw-r--r-- | src/rcore.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/rcore.c b/src/rcore.c index fe1f20a0..06f9bbdd 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -3188,14 +3188,12 @@ FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool } // Unload directory filepaths +// WARNING: files.count is not reseted to 0 after unloading void UnloadDirectoryFiles(FilePathList files) { - if (files.count > 0) - { - for (unsigned int i = 0; i < files.count; i++) RL_FREE(files.paths[i]); + for (unsigned int i = 0; i < files.capacity; i++) RL_FREE(files.paths[i]); - RL_FREE(files.paths); - } + RL_FREE(files.paths); } // Change working directory, returns true on success |
