From a919c6184e4e542a2aa9ecc5013b5907deb37288 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 31 Jan 2023 13:39:39 -0800 Subject: Avoid leaking texture->tex_id when clearing render targets --- drivers/gles3/storage/texture_storage.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index 97698af0a0..d95eb1db02 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -1822,6 +1822,10 @@ void TextureStorage::_clear_render_target(RenderTarget *rt) { rt->overridden.color = RID(); } else if (rt->color) { glDeleteTextures(1, &rt->color); + if (rt->texture.is_valid()) { + Texture *tex = get_texture(rt->texture); + tex->tex_id = 0; + } } rt->color = 0; -- cgit v1.2.3