1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-11 01:52:32 +01:00

Fix a few assertions that were found when using debug CRT

This commit is contained in:
Ted John
2018-03-06 19:40:50 +00:00
committed by Michał Janiszewski
parent cd6739c340
commit e318e0948a
3 changed files with 18 additions and 6 deletions

View File

@@ -68,9 +68,15 @@ public:
}
~HardwareDisplayDrawingEngine() override
{
if (_screenTexture != nullptr)
{
SDL_DestroyTexture(_screenTexture);
}
if (_scaledScreenTexture != nullptr)
{
SDL_DestroyTexture(_scaledScreenTexture);
}
SDL_FreeFormat(_screenTextureFormat);
SDL_DestroyRenderer(_sdlRenderer);
}
@@ -92,8 +98,11 @@ public:
}
void Resize(uint32 width, uint32 height) override
{
if (_screenTexture != nullptr)
{
SDL_DestroyTexture(_screenTexture);
}
SDL_FreeFormat(_screenTextureFormat);
SDL_RendererInfo rendererInfo = {};
@@ -127,8 +136,11 @@ public:
}
if (smoothNN)
{
if (_scaledScreenTexture != nullptr)
{
SDL_DestroyTexture(_scaledScreenTexture);
}
char scaleQualityBuffer[4];
snprintf(scaleQualityBuffer, sizeof(scaleQualityBuffer), "%u", scaleQuality);

View File

@@ -567,7 +567,7 @@ static bool server_compare(const server_entry &a, const server_entry &b)
}
// Then by name
return String::Compare(a.name, b.name, true) <= 0;
return String::Compare(a.name, b.name, true) < 0;
}
static void sort_servers()

View File

@@ -44,7 +44,7 @@ static bool StringIsBlank(const utf8 * str)
{
for (auto ch = str; *ch != '\0'; ch++)
{
if (!isblank(*ch))
if (!isblank((uint8)*ch))
{
return false;
}