summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2023-09-17 20:42:45 +0200
committerRay <[email protected]>2023-09-17 20:42:45 +0200
commit97c4333803234845c0535d4c53985268aeaf4798 (patch)
treee31f0426c87433b08ef5c43c53493983c3cfac5f
parentacf211a5fa1f90cae7a8f8832e3a675720b02f73 (diff)
downloadraylib-97c4333803234845c0535d4c53985268aeaf4798.tar.gz
raylib-97c4333803234845c0535d4c53985268aeaf4798.zip
REVIEWED: `UnloadRenderTexture()`, additional check
-rw-r--r--src/rtextures.c7
1 files 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