Hello.
I have a UActorComponent with a TSet member which has pointers to objects inheriting from UObject.
Once in a while the GC collects the objects pointed to by the TSet elements.
Unlike TArray the TSet cannot be specified as a 'UPROPERTY' so I was wondering how I can make the GC not collect the objects pointed to.
I read this blog post: https://www.unrealengine.com/blog/ue...uld-know-about
It states the following: "Caveat: Unlike TArray, TSets (and TMaps) are not directly supported as UPROPERTYs and so cannot be automatically replicated, serialized, etc. If a TSet (or TMap) is used with hard UObject references (example: TSet<UObject*>), it is up to the user to make sure those references are properly serialized for the purposes of garbage collection. Someone has to take out the trash…"
So in regards to this I was wondering what is meant by the user having to properly serialize the references and if this is the solution to my problem?
I have a UActorComponent with a TSet member which has pointers to objects inheriting from UObject.
Once in a while the GC collects the objects pointed to by the TSet elements.
Unlike TArray the TSet cannot be specified as a 'UPROPERTY' so I was wondering how I can make the GC not collect the objects pointed to.
I read this blog post: https://www.unrealengine.com/blog/ue...uld-know-about
It states the following: "Caveat: Unlike TArray, TSets (and TMaps) are not directly supported as UPROPERTYs and so cannot be automatically replicated, serialized, etc. If a TSet (or TMap) is used with hard UObject references (example: TSet<UObject*>), it is up to the user to make sure those references are properly serialized for the purposes of garbage collection. Someone has to take out the trash…"
So in regards to this I was wondering what is meant by the user having to properly serialize the references and if this is the solution to my problem?
Comment