Clear the material cache data in TerrainChunk::_exit_tree().

This commit is contained in:
Relintai 2025-02-08 14:22:03 +01:00
parent a2784fd2a0
commit d0fa4ba194

View File

@ -1250,6 +1250,9 @@ void TerrainChunk::_exit_tree() {
if (_library.is_valid() && _library->supports_caching()) { if (_library.is_valid() && _library->supports_caching()) {
if (material_cache_key_has()) { if (material_cache_key_has()) {
_library->material_cache_unref(material_cache_key_get()); _library->material_cache_unref(material_cache_key_get());
material_cache_key_set(0);
material_cache_key_has_set(false);
} }
} }
} }