Ch3 Memory Management, Smart Pointers and Debugging¶
-
Managed Memory :¶
- allocate memory there’s several ways to perform it
NewObject<>ConstructObject<>SpawnActor
can be found more in docs
-
de-allcate memory object can be destroyed by calling member function of it
this->ConditionalBeginDestroy()
-
smart pointers
TSharedPtr: A thread-safe reference-counter pointer indicates a share objectTAutoPtr: A non-thread-safe pointerTScopedPointerexample
-
garbage collection
GetWorld()->ForceGarbageCollection(true)