Skip to content

Commit

Permalink
Merge pull request godotengine#59345 from BastiaanOlij/call_correct_t…
Browse files Browse the repository at this point in the history
…exture_free

Call the correct texture free method on texture storage cleanup
  • Loading branch information
akien-mga authored Mar 20, 2022
2 parents b05e56e + 0b5a9e4 commit 5901d91
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5901d91

Please sign in to comment.