summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-01 07:32:05 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-01 07:32:05 +0100
commit92f3725da807b79b6f8e162dc97eea1fadc23d76 (patch)
tree5c736da4b7aea2fcd2eb611da4abdea895b679b7 /drivers
parent0ba7e5a40aeb6ca890266ca3962d8cc64f3a9161 (diff)
parenta919c6184e4e542a2aa9ecc5013b5907deb37288 (diff)
Merge pull request #72474 from clayjohn/GL-leaky-tex
Avoid leaking texture->tex_id when clearing render targets
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/storage/texture_storage.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp
index 9518751d73..9c9c39cc0e 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;