From 922e7e5134fe3fcd59e516fb5207fe864c1bdcac Mon Sep 17 00:00:00 2001 From: Ben Rog-Wilhelm Date: Tue, 24 Sep 2024 14:06:57 -0500 Subject: [PATCH] Fix: Material storage asserts on shutdown if it has pending updates. --- drivers/gles3/storage/material_storage.cpp | 2 ++ servers/rendering/renderer_rd/storage_rd/material_storage.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index c29c741c2a1..ee19ba9ee17 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -1506,6 +1506,8 @@ MaterialStorage::~MaterialStorage() { memdelete_arr(global_shader_uniforms.buffer_dirty_regions); glDeleteBuffers(1, &global_shader_uniforms.buffer); + material_update_list.clear(); + singleton = nullptr; } diff --git a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp index 3bfc1bd15ca..7211e2696d0 100644 --- a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp @@ -1180,6 +1180,8 @@ MaterialStorage::~MaterialStorage() { //def samplers samplers_rd_free(default_samplers); + material_update_list.clear(); + singleton = nullptr; }