Recently I converted my project from 4.9 to 4.10.1, and always get crash every time when I closing a PIE session or closing blueprint window.
This never happened in 4.9.
If I run PIE and stop, or open my blueprint and close it, engine will crash in SceneComponent.cpp line 680:
checkf(ChildCount > AttachChildren.Num(), TEXT(“AttachChildren count increased while detaching ‘%s’, likely caused by OnAttachmentChanged introducing new children, which could lead to an infinite loop.”), *Child->GetName());
I also found similar bug report, but I found more easily way and more information about this crash.
This bug can reproduce in blank UE4.10 and UE4.9 C++ project.
However in UE4.9 only have incorrect behavior, but this incorrect behavior caused crash in UE4.10.
Reproduce steps:
1 Create a C++ class called MyBaseActor as attached files shows [link text][1].
2 Create a BP class MyFirstBPActor derived from MyBaseActor
Add a variable “manager” which type is Actor.
3 Create a BP class DerivedBPActor derived from MyFirstBPActor
4 Create a BP Interface ActorManagerInterface which has 2 functions
Briefly writting in C++ is:
one is DerivedBPActor FindActor( FName name );
other is bool ExecuteActor( DerivedBPActor );
As ExecuteActor.png and FindActor.png shows.
5 Edit Construction script in “both” DerivedBPActor and MyFirstBpActor:
Add codes such like: (written in C++ like)
out = manager->FindActor( "actorName" );
bool success = manager->ExecuteActor( out );
As NodesInDerivedBPActorAndMyFirstBPActor.png shows.
6 Compile all class, save, and reopen UE4.
7 Open MyFirstBPActor and close it. It works fine.
8 Open DerivedBPActor and close it. It gets crash.
If we print children components of DerivedBPActor in ConstructionScript.
It shows 4 children components:
LogBlueprintUserMessages: [DerivedBPActor_C_0] Component nums: 4
LogBlueprintUserMessages: [DerivedBPActor_C_0] TRASH_Default__MyFirstBPActor_C_0.CapsuleComponent
LogBlueprintUserMessages: [DerivedBPActor_C_0] TRASH_Default__MyFirstBPActor_C_0.StaticMeshComponent
LogBlueprintUserMessages: [DerivedBPActor_C_0] DerivedBPActor_C_0.CapsuleComponent
LogBlueprintUserMessages: [DerivedBPActor_C_0] DerivedBPActor_C_0.StaticMeshComponent
crash condition in this case (SceneComponent.cpp line 680) is
ChildCount=2 > AttachChildren.Num()=2, so checkf fails.
It is because parent of TRASH_Default__MyFirstBPActor_C_0.StaticMeshComponent is not DerivedBPActor->RootComponent.
Please let me know if you require more information.
Thank you.