Description

A race condition occurs in the InitSplineVertexFactory_Internal }}function call, which is distributed across multiple threads. This causes {{FSplineMeshVertexFactory to be instantiated multiple times, each instance being stored in the same variable. As a result, all but the last instance leak.

A simple fix using a critical section for mutual exclusion, as shown below, suppresses the leak.

static FCriticalSection GInitSplineVertexFactoryCS;  //work around - global critical section
 
static void InitSplineVertexFactory_Internal(FStaticMeshVertexFactories& VertexFactories, const FStaticMeshVertexBuffers& VertexBuffers, int32 LightMapCoordinateIndex, const ERHIFeatureLevel::Type FeatureLevel, FColorVertexBuffer* InOverrideColorVertexBuffer)
{
	// Skip LODs that have their render data stripped (eg. platform MinLod settings)
	if (VertexBuffers.StaticMeshVertexBuffer.GetNumVertices() == 0)
	{
		return;
	}
 
	bool bOverrideColorVertexBuffer = !!InOverrideColorVertexBuffer;
 
	FScopeLock Lock(&GInitSplineVertexFactoryCS); // work around
 
	if ((VertexFactories.SplineVertexFactory && !bOverrideColorVertexBuffer) || (VertexFactories.SplineVertexFactoryOverrideColorVertexBuffer && bOverrideColorVertexBuffer))
 
Steps to Reproduce
  • Download the repro project from the linked location and build/launch it in UE5.6~5.8
  • Create a packaged build for windows from the editor
  • Once the package launches, press keyboard "1" to load the sublevel
  • Repeatedly press keyboard "2" and "3" in alternation
  • Open command windows and run rhi.DumpResourceMemory all -csvfile , then check the output CSV file

Result:
A large number of SplineMeshComponent VB/TB/TC entries are reported, indicating a leak.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-389807 in the post.

0
Login to Vote

Unresolved
ComponentUE - Rendering - Features
Affects Versions5.65.75.8
CreatedAug 3, 2026
UpdatedAug 4, 2026
View Jira Issue