The Destructible->release() call. I went with
virtual void ExecCommand()
{
PxRigidDynamic** PActorBuffer = NULL;
PxU32 PActorCount = 0;
if (Destructible->acquirePhysXActorBuffer(PActorBuffer, PActorCount, DestructiblePhysXActorQueryFlags::AllStates | DestructiblePhysXActorQueryFlags::AllowActorsNotInScenes))
{
for(uint32 ActorIdx = 0; ActorIdx < PActorCount; ++ActorIdx)
{
PxRigidDynamic* PActor = PActorBuffer[ActorIdx];
OwningScene->RemoveActiveRigidActor(PST_Sync, PActor);
OwningScene->RemoveActiveRigidActor(PST_Async, PActor);
}
Destructible->releasePhysXActorBuffer();
}
Destructible->release();
}
When testing acquirePhysXActorBuffer.