Hello.
I wanted to know if there was a way to destroy or delete structs from memory, and how unreal engine performs garbage collection for structs.
Do structs that have not been used, get purged from memory?
For example, I wish to make an ability system where I have structs for health, mana, stamina as:
struct FAttributeStruct {
float value;
float minimum_value;
float maximum_value;
};
If I have values for health struct-variable in a character/Actor/ActorComponent, will the health struct be deleted from memory if not used, by the UE garbage collector?
Secondly, In this scenario, can I also make a TMap<FString, FAttributeStruct *>
, such that I can map keys to FAttributeStruct
pointers?
Will there be a case where dereferencing those pointers can yield a nullptr
?
Thirdly, can I destroy structs similar to destroying actors or components?
Thanks in advance.