Browse Source

added missing initialization and set pointer to NULL after deletion

Thomas Fischer 12 years ago
parent
commit
aece85f02a
2 changed files with 2 additions and 0 deletions
  1. 1 0
      Engine/source/T3D/fx/particleEmitter.cpp
  2. 1 0
      Engine/source/T3D/shapeBase.cpp

+ 1 - 0
Engine/source/T3D/fx/particleEmitter.cpp

@@ -726,6 +726,7 @@ ParticleEmitter::ParticleEmitter()
    mCurBuffSize = 0;
 
    mDead = false;
+   mDataBlock = NULL;
 
    // ParticleEmitter should be allocated on the client only.
    mNetFlags.set( IsGhost );

+ 1 - 0
Engine/source/T3D/shapeBase.cpp

@@ -958,6 +958,7 @@ ShapeBase::~ShapeBase()
    if( mShapeInstance && (mShapeInstance->getDebrisRefCount() == 0) )
    {
       delete mShapeInstance;
+      mShapeInstance = NULL;
    }
 
    CollisionTimeout* ptr = mTimeoutList;