Pig of a crash - "Pure virtual function being called while application was running"

This is a “Me Too” but with a solve.

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

Solution:

Delete the Binaries, Build, DerivedDataCache, Intermediate, and Saved folders from your project folder. Restart the editor and it will load fine.

I’m experiencing the same error, I’ve tried many things but it doesn’t work, now have you found the problem? This mistake is a big headache for me

Install “Editor symbols for debugging”, otherwise this stack trace is not very helpful.

  1. Open Epic Games launcher
  2. Go to Library at the top.
  3. Click the down arrow in your engine install
  4. Click Options
  5. Check “Editor symbols for debugging”

This will trigger a download which is quite large, but that will give us alot more info about the problem.

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.

I have the same problem with Unreal Engine 4.26