Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 3, 2015, 1:31:18 PM (9 years ago)
Author:
landauf
Message:

moved destruction of bullet collision shape to ~CollisionShape(). CompoundCollisionShape needs some trickery to avoid that a shape gets deleted twice because it does some magic (i.e. assignments) in CompoundCollisionShape::updatePublicShape()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/orxonox/collisionshapes/CompoundCollisionShape.cc

    r9667 r10417  
    7171                it->first->notifyDetached();
    7272                it->first->destroy();
     73                if (this->collisionShape_ == it->second)
     74                    this->collisionShape_ = NULL; // don't destroy it twice
    7375            }
    7476
    7577            delete this->compoundShape_;
     78            if (this->collisionShape_ == this->compoundShape_)
     79                this->collisionShape_ = NULL; // don't destroy it twice
    7680        }
    7781    }
Note: See TracChangeset for help on using the changeset viewer.