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.