How does TArray keep references? My custom container is getting it's elements garbage collected

TArray is specifically integrated in as a base property type, adding new types is a very involved process and adding TMap has been a long ongoing process, it would not be recommended that you take that approach.

Anything that is a USTRUCT can be a property, so that may be an option for you, but otherwise you just have to manually wire it in to the AddReferencedObject system.

1 Like