UBehaviorTreeComponent::UninitializeComponent
#include "BehaviorTree/BehaviorTreeComponent.h"
Access: public
Specifiers: virtualoverride
Description
Overrides UActorComponent::UninitializeComponent to tear down the behavior tree instance stack and release runtime node memory before the component is destroyed.
Caveats & Gotchas
- • Called by the engine's component lifecycle, not something to invoke directly from game code.
- • Runs after EndPlay in the normal actor teardown sequence, so any cleanup relying on world state should happen in StopTree/EndPlay instead.
- • If overridden in a derived class, Super::UninitializeComponent() must be called or the tree instance stack and node memory can leak.
Signature
virtual void UninitializeComponent() override; Return Type
void Example
Extend cleanup in a derived component C++
void UMyBehaviorTreeComponent::UninitializeComponent()
{
// Custom cleanup here
Super::UninitializeComponent();
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?