Just as title says, Will calling UUserWidget::RemoveFromViewport() destory/Delete the widget and clear the memory?
Hi! The base things are
- when widget is added to viewport Construct (NativeConstruct in C++) is called
- when widget is removed from viewport Destruct (NativeDestruct in C++) is called
Next steps of deleting depends on other existing pointers and references to widget object. This level of clean up is implemented in UObject class and those connected to it (see, for example, methods containing Destroy in their names). If there are no references anymore object is marked for deletion. But remember, because Unreal has GC even objects that are not referenced are removed and cleared up with some small delay, according to GC cleaning cycles. Sometimes when it is critical, you can force GC to collect all with GEngine->ForceGarbageCollection
Thank you, and I would love to mark yours as answer, but this one is a comment I think.