I’d like to report a crash occurring in Unreal Engine 5.6.1 when unloading a world partition cell that contains PCG Partitioned Actors referencing Blueprint classes.
Prerequisites:
Unreal Engine version: 5.6.1
A World Partition level
A PCGComponent configured for partitioning and set to be load as preview
The PCG graph scatters Blueprint actors (not static mesh actors)
A Level Instance placed in the same cell
Steps to Reproduce:
Instantiate an actor with a PCG graph in the world.
Configure the PCGComponent to scatter Blueprint-based actors.
Place a Level Instance in the same world partition cell as the PCG actor.
Save the level.
Generate using the commandlet.
Open the level
Load the cell
Unload the cell and observe the crash.
Crash Details:
During the unloading process, the following sequence occurs:
The PCG subsystem is notified.
Mapping info (e.g., FPCGActorAndComponentMapping) is removed.
The PCGComponent of the partitioned actor is asked to remove its reference.
A cleanup is triggered.
The cleanup calls AddResources, which attempts to load resources already unloadedPCG Managed Actors
This results in an assertion failure, as async loading is not allowed during garbage collection.
Please let me know if additional logs or a minimal reproduction project would help. I’d be happy to provide more details.
We could but unfortunately, we don’t have the bandwidth at the moment.
I am not seeing the callstack in the thread. Can you confirm you received it as I remember sharing it when filling the message?
Also, this is only happening when,
A PCG Partition Actor is loaded in a region that also has a Level Instance loaded nearby
Unloading the area, would trigger the LI to unload, and causes GC
GC causes the Original Component to unload -> Which causes Partition Actor to Unregister and Remove its Graph Instance
RemoveGraphInstance always attempts to Cleanup Local Components. 5.6 introduces a feature to force-load unloaded actors when cleaning up, causing the assert
As a temp fix, we added a garbage collection check in APCGPartitionActor::RemoveGraphInstance(UPCGComponent* OriginalComponent)
if (!IsGarbageCollecting())
{
LocalComponent->CleanupLocalImmediate(/*bRemoveComponents=*/true);
}