I had just come across this issues but with 5.2.1. I found this post looking for answers.
I had not modified any of the C++ code but the error was pointing to something in the engine. Given that it was something I did not touch, just assumed that the engine code got corrupted somehow. I simply uninstalled the engine and re-installed it, and the project came back up OK. So if you hit this issue, a fresh install of the engine can be a reasonable fix.
I’ve recently got this problem and found the cause, which might give you guys struggling with the same issue some ideas. In my case it was that i tried to get an array of certain widgets in players beginplay event, which resulted in occasional crashing on level restart - because widgets take longer to pop into existence, as a result - sometimes game tried to refer to non-existing thing. I’ve fixed it by adding a small delay before i try to access widgets.
I’ve reinstalled the engine, did ton of other things, but all i had to do was add a small delay
Just wanted to document for posterity a situation where I ran into this crash and none of the suggestions in this thread helped, but I figured it out.
I had some C++ code like this:
void FMassActorUtils::OnEntityAssociated(const AActor* Actor, const FCallbackWithEntity& OnEntityAssociatedCallback)
{
const UWorld* World = Actor->GetWorld();
UMassAgentSubsystem* AgentSubsystem = World->GetSubsystem<UMassAgentSubsystem>();
const FDelegateHandle OnMassAgentComponentEntityAssociatedHandle = AgentSubsystem->GetOnMassAgentComponentEntityAssociated().AddLambda([Actor, OnEntityAssociatedCallback](const UMassAgentComponent& AgentComponent)
{
if (AgentComponent.GetOwner() == Actor)
{
// Some code here to remove the AddLambda delegate from above
OnEntityAssociatedCallback(AgentComponent.GetEntityHandle());
}
});
}
It was crashing on the OnEntityAssociatedCallback(...) line. This is apparently an issue I’m guessing because what happens is that the delegate is the only thing preventing OnEntityAssociatedCallback from getting deallocated. If you remove the delegate instance before calling OnEntityAssociatedCallback (or more generally using any of the lambda capture list variables) you’ll get this crash. To resolve, make sure to remove the delegate instance after you use any variables from the lambda capture list.
Just for reference, I’m in a BP based project (not a single one C++ own class), and the Editor sometimes crashed giving this error when attaching a particular BP of mine to the PlayerStart instance. In other cases, it crashed afterwards when moving around the PlayerStart with the BP as a child, and then press Ctrl+Z.
Besides, I’m using Paper2D and PaperZD for the attached BP.
Dont known about you guys, but this error occurs with me every time i press the escape or leave the PIE (quit game), and i realized that it only occurs when the level sequencer is open! weird!!, All i have to do is remember to start my game PIE with the level sequencer shuted down! This simple action worked perfect for me! no more errors while sequencer isnt open while playing the level…
@IvanMiskalo thanks for the clue on this one. We were able to track one of these crashes down recently that related to Sequencer. It has been fixed for the next release (5.6). In case anyone is encountering this and is compiling from source, the fix is: