-
Book Overview & Buying
-
Table Of Contents
Unreal Engine 4 Scripting with C++ Cookbook
By :
UObjects are reference-counted and garbage-collected when there are no more references to the UObject instance. Memory allocated on a UObject class derivative using ConstructObject<> or NewObject< > can also be deallocated manually (before the reference count drops to 0) by calling the UObject::ConditionalBeginDestroy() member function.
You'd only do this if you were sure you no longer wanted UObject or the UObject class derivative instance in memory. Use the ConditionalBeginDestroy() function to release memory.
The following code demonstrates the deallocation of a UObject class:
UObject *o = NewObject< UObject >( ... ); o->ConditionalBeginDestroy();
The command ConditionalBeginDestroy() begins the deallocation process, calling the BeginDestroy() and FinishDestroy() overrideable functions.
Be careful not to call UObject::ConditionalBeginDestroy() on any object still being referenced...
Change the font size
Change margin width
Change background colour