1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00

Fix some memory leaks

This commit is contained in:
LRFLEW
2018-10-04 01:42:22 -06:00
committed by Michael Steenbeek
parent 82107e5666
commit c41f862920
3 changed files with 10 additions and 5 deletions

View File

@@ -92,6 +92,11 @@ public:
void Resize(uint32_t width, uint32_t height) override
{
if (width == 0 || height == 0)
{
return;
}
if (_screenTexture != nullptr)
{
SDL_DestroyTexture(_screenTexture);

View File

@@ -34,11 +34,11 @@ std::vector<server_entry> server_list_read()
for (size_t i = 0; i < numEntries; i++)
{
server_entry serverInfo;
serverInfo.address = fs.ReadString();
serverInfo.name = fs.ReadString();
serverInfo.address = fs.ReadStdString();
serverInfo.name = fs.ReadStdString();
serverInfo.requiresPassword = false;
serverInfo.description = fs.ReadString();
serverInfo.version = String::Duplicate("");
serverInfo.description = fs.ReadStdString();
serverInfo.version = "";
serverInfo.favourite = true;
serverInfo.players = 0;
serverInfo.maxplayers = 0;

View File

@@ -110,7 +110,7 @@ void StringTable::SetString(uint8_t id, uint8_t language, const std::string& tex
StringTableEntry entry;
entry.Id = id;
entry.LanguageId = language;
entry.Text = String::Duplicate(text);
entry.Text = text;
_strings.push_back(entry);
}