mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix material removal clearing all instances of shared texture arrays
This commit is contained in:
parent
e67074d0ab
commit
919006eb35
2 changed files with 4 additions and 2 deletions
|
|
@ -2398,7 +2398,8 @@ void MaterialStorage::material_free(RID p_rid) {
|
||||||
// This happens when the app is being closed.
|
// This happens when the app is being closed.
|
||||||
for (KeyValue<StringName, Variant> &E : material->params) {
|
for (KeyValue<StringName, Variant> &E : material->params) {
|
||||||
if (E.value.get_type() == Variant::ARRAY) {
|
if (E.value.get_type() == Variant::ARRAY) {
|
||||||
Array(E.value).clear();
|
// Clear the array for this material only (the array may be shared).
|
||||||
|
E.value = Variant();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2235,7 +2235,8 @@ void MaterialStorage::material_free(RID p_rid) {
|
||||||
// This happens when the app is being closed.
|
// This happens when the app is being closed.
|
||||||
for (KeyValue<StringName, Variant> &E : material->params) {
|
for (KeyValue<StringName, Variant> &E : material->params) {
|
||||||
if (E.value.get_type() == Variant::ARRAY) {
|
if (E.value.get_type() == Variant::ARRAY) {
|
||||||
Array(E.value).clear();
|
// Clear the array for this material only (the array may be shared).
|
||||||
|
E.value = Variant();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue