collide: Deconstruct CPhysCollide properly

It is necessary to dispatch the correct JPH::Shape dtor, even though
it's stored as a a CPhysCollide*.

This should fix #58
pull/140/head
Magnus Larsen 3 months ago committed by Joshie
parent 6c1ec77980
commit 0c55d0082d

@ -700,7 +700,7 @@ void JoltPhysicsCollision::VCollideUnload( vcollide_t *pVCollide )
{
VCollideFreeUserData( pVCollide );
for ( int i = 0; i < pVCollide->solidCount; i++ )
delete pVCollide->solids[ i ];
delete pVCollide->solids[ i ]->ToShape();
delete[] pVCollide->solids;
delete[] pVCollide->pKeyValues;

@ -12,6 +12,8 @@
// Does not and will not contain *any* data.
class CPhysCollide
{
~CPhysCollide() = delete;
public:
JPH::Shape* ToShape()
{
@ -42,6 +44,8 @@ public:
// Does not and will not contain *any* data.
class CPhysConvex
{
~CPhysConvex() = delete;
public:
JPH::ConvexShape* ToConvexShape()
{

Loading…
Cancel
Save