mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +00:00
Fix memory leak when passing directories to -file
This commit is contained in:
parent
efa82cf38b
commit
fc6f983c13
1 changed files with 4 additions and 1 deletions
|
@ -111,9 +111,12 @@ FDirectory::FDirectory(const char * directory)
|
|||
#ifdef _WIN32
|
||||
directory = _fullpath(NULL, directory, _MAX_PATH);
|
||||
#else
|
||||
// Todo for Linux: Resolve the path befire using it
|
||||
// Todo for Linux: Resolve the path before using it
|
||||
#endif
|
||||
dirname = directory;
|
||||
#ifdef _WIN32
|
||||
free((void *)directory);
|
||||
#endif
|
||||
dirname.ReplaceChars('\\', '/');
|
||||
if (dirname[dirname.Len()-1] != '/') dirname += '/';
|
||||
Filename = copystring(dirname);
|
||||
|
|
Loading…
Reference in a new issue