Garbage Collector Guarantees

Hello,

To ensure that the object will be properly handled in terms of Garbage Collection (in other words, it won’t get deleted while still being referenced in your code), please make sure that the following conditions are met:

  1. You use UObject and UObject-derived objects (in other case, please use Smart Pointers);

  2. Your class members are declared as UPROPERTY;

Please also note that the only type-safe container is TArray.

If you like to learn more about Garbage Collection in Unreal Engine 4, please go here:

Hope this helped!

Cheers!