Raw Pointers versus Smart Pointers

Shouldnt we use Smar Pointers rather than Raw pointers in general

if you are referring to UObject* i UCapsuleComponent, UStaticMeshComponent and what not, those are managed through the reflection library, and are garbage collected as needed

https://docs.unrealengine.com/en-US/Programming/UnrealArchitecture/Objects/Optimizations/index.html#:~:text=against%20the%20MegaBoss.-,Garbage%20Collection,and%20which%20ones%20are%20orphaned.

2 Likes

thank you …that was awesome…
it looks like raw pointers are OK for UObjects …Looks like Unreal takes care of us…:slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms