The leaking variable is UInstancedStaticMeshComponent::InstanceDataBuffers.
The memory block is passed to InitPerInstanceRenderData() via InstanceDataBuffers.Release(). But the function doesn't manage the passed memory block.
Following workaround works.
void UInstancedStaticMeshComponent::OnPostLoadPerInstanceData() { if (!HasAnyFlags(RF_ClassDefaultObject|RF_ArchetypeObject)) { // create PerInstanceRenderData and pass InstanceDataBuffers ownership to it #if 0 InitPerInstanceRenderData(true, InstanceDataBuffers.Release()); #else InitPerInstanceRenderData(true, InstanceDataBuffers.Get()); #endif } // release InstanceDataBuffers InstanceDataBuffers.Reset();
void UHierarchicalInstancedStaticMeshComponent::OnPostLoadPerInstanceData() { ... if (!bForceTreeBuild) { // Create PerInstanceRenderData either from current data or pre-built instance buffer #if 0 InitPerInstanceRenderData(true, InstanceDataBuffers.Release()); #else InitPerInstanceRenderData(true, InstanceDataBuffers.Get()); #endif NumBuiltRenderInstances = PerInstanceRenderData->InstanceBuffer_GameThread->GetNumInstances(); InstanceCountToRender = NumBuiltInstances; } // If any of the data is out of sync, build the tree now! BuildTreeIfOutdated(bAsyncTreeBuild, bForceTreeBuild); } } InstanceDataBuffers.Reset(); }
InstancedMesh LLM counter keeps increasing.
I am not able to find world outliner how to enable it?
How to achieve HLSL Multiple Render Target in Material blueprints?
What property of the Slider is the image used when dragging?
What properties of the progress bar can be used for drag and drop highlighting?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
How can i modify the param name in EQS node
When I open UE4 4.24.3 it appears that. Does anyone know how to solve?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-109898 in the post.
0 |
Component | UE - World Creation - Worldbuilding Tools - Foliage |
---|---|
Affects Versions | 4.25 |
Target Fix | 4.27 |
Created | Mar 3, 2021 |
---|---|
Resolved | Mar 19, 2021 |
Updated | Nov 30, 2022 |