Skip to content

Commit c001010

Browse files
committed
REVIEWED: UnloadDirectoryFiles()
1 parent f6558fe commit c001010

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/rcore.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3188,14 +3188,12 @@ FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool
31883188
}
31893189

31903190
// Unload directory filepaths
3191+
// WARNING: files.count is not reseted to 0 after unloading
31913192
void UnloadDirectoryFiles(FilePathList files)
31923193
{
3193-
if (files.count > 0)
3194-
{
3195-
for (unsigned int i = 0; i < files.count; i++) RL_FREE(files.paths[i]);
3194+
for (unsigned int i = 0; i < files.capacity; i++) RL_FREE(files.paths[i]);
31963195

3197-
RL_FREE(files.paths);
3198-
}
3196+
RL_FREE(files.paths);
31993197
}
32003198

32013199
// Change working directory, returns true on success

0 commit comments

Comments
 (0)