Browse Source

Clean up SFXSources in Player class

mMoveBubbleSound and mWaterBreathSound were not being deleted properly
Lorne McIntosh 12 years ago
parent
commit
f535147038
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Engine/source/T3D/player.cpp

+ 6 - 0
Engine/source/T3D/player.cpp

@@ -1763,6 +1763,12 @@ void Player::onRemove()
    setControlObject(0);
    scriptOnRemove();
    removeFromScene();
+   
+   if ( isGhost() )
+   {
+      SFX_DELETE( mMoveBubbleSound );
+      SFX_DELETE( mWaterBreathSound );
+   }
 
    U32 i;
    for( i=0; i<PlayerData::NUM_SPLASH_EMITTERS; i++ )