Merge pull request #72474 from clayjohn/GL-leaky-tex

Avoid leaking texture->tex_id when clearing render targets
This commit is contained in:
Rémi Verschelde 2023-02-01 07:32:05 +01:00
commit 92f3725da8
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

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