diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/input/touch/touchmanager.cpp | 1 | ||||
-rw-r--r-- | src/utils/files.cpp | 14 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/input/touch/touchmanager.cpp b/src/input/touch/touchmanager.cpp index be6dd072d..28929db19 100644 --- a/src/input/touch/touchmanager.cpp +++ b/src/input/touch/touchmanager.cpp @@ -86,6 +86,7 @@ void TouchManager::shutdown() restrict2 void TouchManager::init() restrict2 { + delete mVertexes; mVertexes = new ImageCollection; config.addListener("showScreenJoystick", this); diff --git a/src/utils/files.cpp b/src/utils/files.cpp index 463031493..6f7ae3147 100644 --- a/src/utils/files.cpp +++ b/src/utils/files.cpp @@ -355,14 +355,16 @@ void Files::deleteFilesInDirectory(std::string path) const struct dirent *next_file = nullptr; DIR *const dir = opendir(path.c_str()); - while ((next_file = readdir(dir))) - { - const std::string file = next_file->d_name; - if (file != "." && file != "..") - remove((path + file).c_str()); - } if (dir) + { + while ((next_file = readdir(dir))) + { + const std::string file = next_file->d_name; + if (file != "." && file != "..") + remove((path + file).c_str()); + } closedir(dir); + } } void Files::getFilesInDir(const std::string &dir, |