mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-19 09:48:15 +00:00
ClearDirectoryFiles(): Corrected memory leak #991
This commit is contained in:
@@ -1976,14 +1976,11 @@ char **GetDirectoryFiles(const char *dirPath, int *fileCount)
|
|||||||
// Clear directory files paths buffers
|
// Clear directory files paths buffers
|
||||||
void ClearDirectoryFiles(void)
|
void ClearDirectoryFiles(void)
|
||||||
{
|
{
|
||||||
if (dirFilesCount > 0)
|
for (int i = 0; i < MAX_DIRECTORY_FILES; i++) RL_FREE(dirFilesPath[i]);
|
||||||
{
|
|
||||||
for (int i = 0; i < dirFilesCount; i++) RL_FREE(dirFilesPath[i]);
|
|
||||||
|
|
||||||
RL_FREE(dirFilesPath);
|
RL_FREE(dirFilesPath);
|
||||||
dirFilesCount = 0;
|
dirFilesCount = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Change working directory, returns true if success
|
// Change working directory, returns true if success
|
||||||
bool ChangeDirectory(const char *dir)
|
bool ChangeDirectory(const char *dir)
|
||||||
|
Reference in New Issue
Block a user