Fix Godot 4.7 typed array crash: add freed-object filtering in PropertyPool and PerObjectHistory
This commit is contained in:
@@ -49,8 +49,14 @@ func get_properties_of(subject: Object) -> Array[NodePath]:
|
||||
return properties
|
||||
|
||||
func get_subjects() -> Array[Object]:
|
||||
# Filter out freed objects — Godot 4.7 stricter typed arrays
|
||||
# reject invalid references and crash the engine.
|
||||
var valid := []
|
||||
for s in _properties_by_subject.keys():
|
||||
if is_instance_valid(s):
|
||||
valid.append(s)
|
||||
var subjects := [] as Array[Object]
|
||||
subjects.assign(_properties_by_subject.keys())
|
||||
subjects.assign(valid)
|
||||
return subjects
|
||||
|
||||
func is_empty() -> bool:
|
||||
|
||||
Reference in New Issue
Block a user