Hi Ori,
I’ve integrated that CL into the 4.18.1 source from github and made a new version for our users. Unfortunately I’m not able to repro the crash myself, but we’ve had reports from several users about it. One has sent me a dump file, which you can find here along with the symbols and log:
https://drive.google.com/file/d/1g7jvY4bCx25ukMkRxobVzGqbOFd1zInv/view?usp=sharing
Looking through this thread, it’s possible that one difference in repro is that I’m not actually destroying any destructible components themselves. Instead, in our game the user can undo destruction, and then the destroyed object should be restored to its intact state. To do this, I have the following function that’s called in the PostPhysics tickgroup, which as you can see sets the mesh to null and then back again:
void UDADecoSceneRecordingComp::RestoreFromStateCache()
{
UWorld* World = GetWorld();
FPhysScene* PhysScene = World->GetPhysicsScene();
PxScene* PSceneasync = (PhysScene->HasAsyncScene()) ? PhysScene->GetPhysXScene(PST_Async) : nullptr;
SCOPED_SCENE_WRITE_LOCK(PSceneasync);
PxScene* PScenesync = PhysScene->GetPhysXScene(PST_Sync);
SCOPED_SCENE_WRITE_LOCK(PScenesync);
GPhysCommandHandler->Flush();
int32 num = m_stateCache.Num();
for (int32 i = 0; i < num; i++)
{
int32 idx = m_stateCache[i].m_idx;
bool isFractured = m_stateCache[i].m_fractured;
UDestructibleComponent *comp = (m_destructibles.IsValidIndex(idx)) ? m_destructibles[idx] : nullptr;
if (comp)
{
if (isFractured != comp->m_isFractured)
{
if (!isFractured)
{
// restore the mesh
UDestructibleMesh * mesh = comp->GetDestructibleMesh();
comp->SetDestructibleMesh(nullptr);
GPhysCommandHandler->Flush();
comp->SetDestructibleMesh(mesh);
}
comp->m_isFractured = isFractured;
}
}
}
}
Perhaps this method is not appropriate, although it worked fine in 4.17 and earlier.
Let me know if you’d prefer a new udn thread about this.