TriAxis-Games / RealtimeMeshComponent

Unreal Engine 5 plugin component for rendering runtime generated content.

Home Page:https://rmc.triaxis.games/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash on Hide/Show with Instances

caseyvan opened this issue · comments

I ran into an odd crash while hiding, then showing two RuntimeMeshComponents that shared a RuntimeMesh. The specific issue was occurring in FRuntimeMeshComponentSceneProxy::CreateMeshBatch because Section.Buffers->VertexFactory was uninitialized. After some digging, it looked like the VertexFactory was being reset due to the reference count of that FRuntimeMeshSectionProxyBuffers instance dropping to zero. This was despite FRuntimeMeshProxy having a pointer to it, and no calls to clear up update that section. It looked to me like a race condition with reference counting, and adding ESPMode::ThreadSafe to FRuntimeMeshSectionProxyBuffers seems to have fixed it. I also noticed that FRuntimeMeshProxy is marked as thread-safe even though the section buffer was not.

Can you make a PR for it ?

Closing as this is now a replaced version of the plugin so previous issues likely won't apply exactly. If you continue to have this issue on the new version, please feel free to reopen!

Thanks!