AActor::UninitializeComponents
#include "GameFramework/Actor.h"
Access: public
Description
Iterates over all components and calls UninitializeComponent on each one. Called when the actor is ending play, mirroring InitializeComponents.
Caveats & Gotchas
- • This is called as part of EndPlay teardown — do not call it manually unless you are implementing a custom actor lifecycle, as double-uninitializing a component is undefined behaviour.
- • UninitializeComponent is symmetric to InitializeComponent; resources acquired there should be released here, not in BeginDestroy.
Signature
ENGINE_API void UninitializeComponents(); Return Type
void Example
Component override that pairs with InitializeComponent C++
void UMyComponent::UninitializeComponent()
{
// Release resources acquired in InitializeComponent
MySubsystemHandle.Reset();
Super::UninitializeComponent();
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?