ClearDirectoryFiles(): Corrected memory leak #991
This commit is contained in:
parent
1878a9ea01
commit
3c2ce77b7b
1 changed files with 3 additions and 6 deletions
|
@ -1976,14 +1976,11 @@ char **GetDirectoryFiles(const char *dirPath, int *fileCount)
|
|||
// Clear directory files paths buffers
|
||||
void ClearDirectoryFiles(void)
|
||||
{
|
||||
if (dirFilesCount > 0)
|
||||
{
|
||||
for (int i = 0; i < dirFilesCount; i++) RL_FREE(dirFilesPath[i]);
|
||||
for (int i = 0; i < MAX_DIRECTORY_FILES; i++) RL_FREE(dirFilesPath[i]);
|
||||
|
||||
RL_FREE(dirFilesPath);
|
||||
dirFilesCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Change working directory, returns true if success
|
||||
bool ChangeDirectory(const char *dir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue