Calling ConditionalBeginDestroy on an ActorComponent (instead of DestroyComponent) can lead to a crash due to the object not being correctly unregistered.
BeginDestroy doesn't unregister tick functions, and there is currently no warning being emitted to safeguard against use of ConditionalBeginDestroy on ActorComponent derivatives.
Create a component using NewObject<USceneComponent>
Allow the component to tick and register it with the world explicitly.
Call ConditionalBeginDestroy
This sets up the conditions to create a crash. The crash occurs if the object is destroyed before the stats system looks up the object.
The actual crash is sporadic and is best replicated by simply leaving the PIE session running.
[Inlined] FUObjectArray::IndexToObject(int) UObjectArray.h:944
`UObjectBaseUtility::GetStatID'::`2'::<lambda_1>::operator()() UObjectBaseUtility.h:783
[Inlined] AutoRTFM::Open(const UObjectBaseUtility::<lambda_1> &) AutoRTFM.h:677
[Inlined] UObjectBaseUtility::GetStatID(bool) UObjectBaseUtility.h:780
`FScopeCycleCounterUObject::FScopeCycleCounterUObject'::`2'::<lambda_1>::operator()() UObjectBaseUtility.h:951
[Inlined] AutoRTFM::Open(const FScopeCycleCounterUObject::<lambda_1> &) AutoRTFM.h:677
[Inlined] FScopeCycleCounterUObject::
(const UObjectBaseUtility *) UObjectBaseUtility.h:946
[Inlined] FActorComponentTickFunction::ExecuteTickHelper(UActorComponent *, bool, float, ELevelTick, const <lambda_1> &) Actor.h:4716
FActorComponentTickFunction::ExecuteTick(float, ELevelTick, Type, const TRefCountPtr<…> &) ActorComponent.cpp:1228
[Inlined] FTickFunctionTask::DoTask(Type, const TRefCountPtr<…> &) TickTaskManager.cpp:306
TGraphTask::ExecuteTask() TaskGraphInterfaces.h:634
UE::Tasks::Private::FTaskBase::TryExecuteTask() TaskPrivate.h:504
[Inlined] FBaseGraphTask::Execute(TArray<…> &, Type, bool) TaskGraphInterfaces.h:482
FNamedTaskThread::ProcessTasksNamedThread(int, bool) TaskGraph.cpp:779
FNamedTaskThread::ProcessTasksUntilIdle(int) TaskGraph.cpp:678
FTickTaskSequencer::ReleaseTickGroup(ETickingGroup, bool) TickTaskManager.cpp:831
FTickTaskManager::RunTickGroup(ETickingGroup, bool) TickTaskManager.cpp:1865
UWorld::RunTickGroup(ETickingGroup, bool) LevelTick.cpp:773
UWorld::Tick(ELevelTick, float) LevelTick.cpp:1511
UEditorEngine::Tick(float, bool) EditorEngine.cpp:2138
UUnrealEdEngine::Tick(float, bool) UnrealEdEngine.cpp:547
FEngineLoop::Tick() LaunchEngineLoop.cpp:5871
[Inlined] EngineTick() Launch.cpp:69
GuardedMain(const wchar_t *) Launch.cpp:190
LaunchWindowsStartup(HINSTANCE__ *, HINSTANCE__ *, char *, int, const wchar_t *) LaunchWindows.cpp:266
WinMain(HINSTANCE__ *, HINSTANCE__ *, char *, int) LaunchWindows.cpp:317
[Inlined] invoke_main() 0x00007ff6d313f2a6
__scrt_common_main_seh() 0x00007ff6d313f285
<unknown> 0x00007fff2d3ce8d7
<unknown> 0x00007fff2d9d14fc
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-277465 in the post.
0 |
Component | UE - CoreTech |
---|---|
Affects Versions | 5.5 |
Created | May 6, 2025 |
---|---|
Updated | May 7, 2025 |