mirror of
https://github.com/godotengine/godot.git
synced 2025-01-27 20:30:54 +00:00
Avoid leaking texture->tex_id when clearing render targets
This commit is contained in:
parent
0810ecaafd
commit
a919c6184e
@ -1822,6 +1822,10 @@ void TextureStorage::_clear_render_target(RenderTarget *rt) {
|
|||||||
rt->overridden.color = RID();
|
rt->overridden.color = RID();
|
||||||
} else if (rt->color) {
|
} else if (rt->color) {
|
||||||
glDeleteTextures(1, &rt->color);
|
glDeleteTextures(1, &rt->color);
|
||||||
|
if (rt->texture.is_valid()) {
|
||||||
|
Texture *tex = get_texture(rt->texture);
|
||||||
|
tex->tex_id = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rt->color = 0;
|
rt->color = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user