From 97c4333803234845c0535d4c53985268aeaf4798 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 17 Sep 2023 20:42:45 +0200 Subject: [PATCH] REVIEWED: `UnloadRenderTexture()`, additional check --- src/rtextures.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rtextures.c b/src/rtextures.c index a6741ee2..8dc49fac 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3793,8 +3793,11 @@ void UnloadRenderTexture(RenderTexture2D target) { if (target.id > 0) { - // Color texture attached to FBO is deleted - rlUnloadTexture(target.texture.id); + if (target.texture.id > 0) + { + // Color texture attached to FBO is deleted + rlUnloadTexture(target.texture.id); + } // NOTE: Depth texture/renderbuffer is automatically // queried and deleted before deleting framebuffer