mgumley
Sun, 30 Apr 2017 22:04:25 +0000
Getting Started & Setup

UE4 crashes every time I hot reload. When I build without the editing running, everything is fine. How can I fix this or at least determine why it’s crashing?

EDIT:
I believe it has something to do with CreateDefaultSubobject. When hot reloading, does the previous default subject not get destroyed?

EDIT #2:
I ran the editor in debug mode using the UE4 source from git. The UHierarchicalInstancedStaticMeshComponent class is trying to reference a null ptr when hot reloading. Here is the function. You can see that ClusterTreePtr is not always assigned a value. Why is this?

void UHierarchicalInstancedStaticMeshComponent::Serialize(FArchive& Ar)
{
	// On save, if we have a pending async build we should wait for it to complete rather than saving an incomplete tree
	if (Ar.IsSaving())
	{
		if (!IsTreeFullyBuilt())
		{
			BuildTree();
		}
	}

	Super::Serialize(Ar);

	if (Ar.IsLoading())
	{
		ClusterTreePtr = MakeShareable(new TArray<FClusterNode>);
	}
	TArray<FClusterNode>& ClusterTree = *ClusterTreePtr;
	ClusterTree.BulkSerialize(Ar);
	if (Ar.IsLoading() && !BuiltInstanceBounds.IsValid)
	{
		BuiltInstanceBounds = (ClusterTree.Num() > 0 ? FBox(ClusterTree[0].BoundMin, ClusterTree[0].BoundMax) : FBox(0));
	}
}

8 posts - 1 participant