Fixed some of the memory leaks and Clang warnings.

DrMemory and Valgrind work with regular debug builds.
This commit is contained in:
Muzychenko Andrey committed 2021-09-14 15:33:18 +03:00
1 parent 28e2417ef9
commit c5b7c0ad16
25 files changed
+74 -97

No files matched your search

+2 -4
View File
@@ -145,7 +145,6 @@ int loader::get_sound_id(int groupIndex)
datFieldTypes::ShortValue));
if (value && *value == 202)
{
char filePath[300]{};
std::string fileName = partman::field(loader_table, soundGroupId, datFieldTypes::String);
// File name is in lower case, while game data is in upper case.
@@ -157,9 +156,8 @@ int loader::get_sound_id(int groupIndex)
fileName.insert(0, "SOUND");
}
pinball::make_path_name(filePath, fileName.c_str());
FILE* file = fopen(filePath, "rb");
auto filePath = pinball::make_path_name(fileName);
auto file = fopen(filePath.c_str(), "rb");
if (file)
{
fread(&wavHeader, 1, sizeof wavHeader, file);