From 0b5a9e4f6ef0fede73b84f5c684e0416af4ef742 Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Sun, 20 Mar 2022 20:10:44 +1100 Subject: [PATCH] Call the correct texture free method on texture storage cleanup --- .../rendering/renderer_rd/storage_rd/texture_storage.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp index acdaaae7a47..4e33e60b3a5 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp @@ -300,12 +300,14 @@ TextureStorage::TextureStorage() { } TextureStorage::~TextureStorage() { - singleton = nullptr; - //def textures for (int i = 0; i < DEFAULT_RD_TEXTURE_MAX; i++) { - texture_free(default_rd_textures[i]); + if (default_rd_textures[i].is_valid()) { + RD::get_singleton()->free(default_rd_textures[i]); + } } + + singleton = nullptr; } bool TextureStorage::can_create_resources_async() const {