From 8fbff61fe109150a02728ee917739d9afedc5575 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:34:46 +0200 Subject: [PATCH] Additional opt --- src/w3d/renderer/textureloader.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/w3d/renderer/textureloader.cpp b/src/w3d/renderer/textureloader.cpp index 4f84be60e..dcf974a0f 100644 --- a/src/w3d/renderer/textureloader.cpp +++ b/src/w3d/renderer/textureloader.cpp @@ -298,8 +298,10 @@ void TextureLoader::Request_Thumbnail(TextureBaseClass *texture) // Possibly this code isn't ever actually used with Thumbnail code in general being minimally // called. if (texture->Get_Thumbnail_Load_Task() != nullptr) { - FastCriticalSectionClass::LockClass lock(g_foregroundCritSec); - g_foregroundQueue.Remove(texture->Get_Thumbnail_Load_Task()); + { + FastCriticalSectionClass::LockClass lock(g_foregroundCritSec); + g_foregroundQueue.Remove(texture->Get_Thumbnail_Load_Task()); + } texture->Get_Thumbnail_Load_Task()->Destroy(); } } else { @@ -496,7 +498,8 @@ void TextureLoader::Process_Foreground_Thumbnail(TextureLoadTaskClass *task) switch (task->Get_Load_State()) { case TextureLoadTaskClass::STATE_NONE: Load_Thumbnail(task->Get_Texture()); - case TextureLoadTaskClass::STATE_FOREGROUND_OVERRIDE: // Fallthrough + [[fallthrough]]; + case TextureLoadTaskClass::STATE_FOREGROUND_OVERRIDE: task->Destroy(); break; default: