Merge pull request #4895 from janisozaur/fixes

memory leak plugs, initialisation of fields
This commit is contained in:
Ted John authored and GitHub committed 2016-12-20 10:43:05 +00:00
commit f378688828
5 files changed
+11 -6

No files matched your search

+3 -1
View File
@@ -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)
+3 -3
View File
@@ -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)
+1 -1
View File
@@ -68,7 +68,7 @@ private:
IPlatformEnvironment * _env;
std::vector<TrackRepositoryItem> _items;
QueryDirectoryResult _directoryQueryResult;
QueryDirectoryResult _directoryQueryResult = { 0 };
public:
TrackDesignRepository(IPlatformEnvironment * env)
+1
View File
@@ -122,6 +122,7 @@ extern "C"
Memory::Free(seq->Saves[i]);
}
Memory::Free(seq->Saves);
Memory::Free(seq);
}
}
+3 -1
View File
@@ -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