Is UProceduralMeshComponent::ClearAllMeshSections() Not Thread Safe?

Hello all,

I’ve started diving into multi-threading using a FAutoDeleteAsyncTask. Everything seems to work fine until I get to the section in my code which calls ClearAllMeshSections() on my UProceduralMeshComponent where the engine crashes at a failed assert. I’ve seen a couple but the most common one is “Ensure condition failed: GetShadowIndex() == 0”.

Everything in the object looks like it is fine to me and the code runs normally while part of the main game thread. Even the other parts of the thread work fine if that part of the code doesn’t get hit.

Is UProceduralMeshComponent::ClearAllMeshSections() Not Thread Safe then? And if so what would be the best practice to get around this error?

Thank you!