Crash changing levels FPSCPool::Cleanup

We are having an issue when running a packaged version of the game, this seems to only really happen on slower hardware.

Crash is occurring on a level change during the clean-up phase, with an Access Violation exception being thrown within FPSCPool::Cleanup(). The call PSC->DestroyComponent() in the 2nd for loop is where the exception is raised, this is within the WorldPSCPool.cpp file.

Clearly this is particle system related (?) If I look at the value of InUseComponents_Auto it contains a lot of what look to be invalid items, I am not sure if these could already have been destroyed by this method already but as the 1st item looks more “valid” I suspect not.

The project is primarily Blueprint based, there is C++ elements but nothing to do with particles and I have disabled nodes that were destroying particle components already. Are there any obvious issues people can think of that may cause this crash?

The crash only happens on levels with gameplay (which feature particles), other “levels” that are not gameplay do not have an issue when changing between them.

Thanks

I have “fixed” this issue by modifying the code in WorldPSCPool.cpp to check for null values and skipping if they are. This stops the crash issue and checking newer engine source shows Epic has implemented this change too, so I guess this is the best fix.

I changed:

for (UParticleSystemComponent* PSC : InUseComponents_Auto)
{
	PSC->DestroyComponent();
}

to

for (UParticleSystemComponent* PSC : InUseComponents_Auto)
{
	if (PSC)
	{
		PSC->DestroyComponent();
	}
	else
	{
		UE_LOG(LogParticles, Warning, TEXT("PSC Autocleanup invalid entry"));
	}
}