mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #4895 from janisozaur/fixes
memory leak plugs, initialisation of fields
This commit is contained in:
commit
f378688828
|
@ -40,7 +40,9 @@ namespace String
|
|||
va_start(args, format);
|
||||
const utf8 * buffer = Format_VA(format, args);
|
||||
va_end(args);
|
||||
return ToStd(buffer);
|
||||
std::string returnValue = ToStd(buffer);
|
||||
Memory::Free(buffer);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
bool IsNullOrEmpty(const utf8 * str)
|
||||
|
|
|
@ -94,11 +94,11 @@ static void ReportMissingObject(const rct_object_entry * entry);
|
|||
|
||||
class ObjectRepository : public IObjectRepository
|
||||
{
|
||||
IPlatformEnvironment * _env;
|
||||
IPlatformEnvironment * _env = nullptr;
|
||||
std::vector<ObjectRepositoryItem> _items;
|
||||
QueryDirectoryResult _queryDirectoryResult;
|
||||
QueryDirectoryResult _queryDirectoryResult = { 0 };
|
||||
ObjectEntryMap _itemMap;
|
||||
uint16 _languageId;
|
||||
uint16 _languageId = 0;
|
||||
|
||||
public:
|
||||
ObjectRepository(IPlatformEnvironment * env)
|
||||
|
|
|
@ -68,7 +68,7 @@ private:
|
|||
IPlatformEnvironment * _env;
|
||||
|
||||
std::vector<TrackRepositoryItem> _items;
|
||||
QueryDirectoryResult _directoryQueryResult;
|
||||
QueryDirectoryResult _directoryQueryResult = { 0 };
|
||||
|
||||
public:
|
||||
TrackDesignRepository(IPlatformEnvironment * env)
|
||||
|
|
|
@ -122,6 +122,7 @@ extern "C"
|
|||
Memory::Free(seq->Saves[i]);
|
||||
}
|
||||
Memory::Free(seq->Saves);
|
||||
Memory::Free(seq);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -240,7 +240,9 @@ namespace TitleSequenceManager
|
|||
if (String::Equals(Path::GetExtension(scanPath), ".txt", true))
|
||||
{
|
||||
// If we are given a .txt file, set the path to the containing directory
|
||||
path = std::string(Path::GetDirectory(scanPath));
|
||||
utf8 * utf8Path = Path::GetDirectory(scanPath);
|
||||
path = std::string(utf8Path);
|
||||
Memory::Free(utf8Path);
|
||||
isZip = false;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue