From 25158fe33bd22871eab47b4a06f951fd6655fad8 Mon Sep 17 00:00:00 2001 From: Sammy Fatnassi Date: Sat, 3 Jan 2026 14:26:29 -0500 Subject: [PATCH] Textures: prevent assert/crash of having a destroyed texture recreated without the pixels data available (#9150, #8811) Amend 8c22b8aef --- imgui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.h b/imgui.h index c69eb1905..62fac5151 100644 --- a/imgui.h +++ b/imgui.h @@ -3509,7 +3509,7 @@ struct ImTextureData // - Call SetTexID() and SetStatus() after honoring texture requests. Never modify TexID and Status directly! // - A backend may decide to destroy a texture that we did not request to destroy, which is fine (e.g. freeing resources), but we immediately set the texture back in _WantCreate mode. void SetTexID(ImTextureID tex_id) { TexID = tex_id; } - void SetStatus(ImTextureStatus status) { Status = status; if (status == ImTextureStatus_Destroyed && !WantDestroyNextFrame) Status = ImTextureStatus_WantCreate; } + void SetStatus(ImTextureStatus status) { Status = status; if (status == ImTextureStatus_Destroyed && !WantDestroyNextFrame && Pixels != nullptr) Status = ImTextureStatus_WantCreate; } }; //-----------------------------------------------------------------------------