Rama
(Rama)
2
private:
UPROPERTY()
UTexture2D *Texture;
Is indeed the correct way
Use UPROPERTY to tell the UE4 GC system to leave your texture, or any spawned/ new object asset alone
Null out the reference when you are ready to have it GC’ed
Texture = nullptr;
#Wiki Tutorial on GC and Dynamic Memory Management
1 Like