REVIEWED: UnloadRenderTexture(), additional check

This commit is contained in:
Ray 2023-09-17 20:42:45 +02:00
parent acf211a5fa
commit 97c4333803

View File

@ -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