Index: code/branches/presentation2/src/orxonox/sound/AmbientSound.cc
===================================================================
--- code/branches/presentation2/src/orxonox/sound/AmbientSound.cc	(revision 6340)
+++ code/branches/presentation2/src/orxonox/sound/AmbientSound.cc	(revision 6349)
@@ -53,4 +53,13 @@
     AmbientSound::~AmbientSound()
     {
+    }
+
+    void AmbientSound::preDestroy()
+    {
+        if (GameMode::playsSound())
+        {
+            // Smoothly fade out by keeping a SmartPtr
+            SoundManager::getInstance().unregisterAmbientSound(this);
+        }
     }
     
Index: code/branches/presentation2/src/orxonox/sound/AmbientSound.h
===================================================================
--- code/branches/presentation2/src/orxonox/sound/AmbientSound.h	(revision 6340)
+++ code/branches/presentation2/src/orxonox/sound/AmbientSound.h	(revision 6349)
@@ -67,4 +67,5 @@
 
     private:
+        virtual void preDestroy();
         void doPlay();
         void doStop();
Index: code/branches/presentation2/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/branches/presentation2/src/orxonox/sound/SoundManager.cc	(revision 6340)
+++ code/branches/presentation2/src/orxonox/sound/SoundManager.cc	(revision 6349)
@@ -314,7 +314,6 @@
     {
         if (oldAmbient == NULL || ambientSounds_.empty())
-        {
             return;
-        }
+
         if (this->ambientSounds_.front().first == oldAmbient) 
         {
@@ -468,8 +467,8 @@
     
 
-    void SoundManager::fadeIn(AmbientSound* sound)
+    void SoundManager::fadeIn(const SmartPtr<AmbientSound>& sound)
     {
         // If we're already fading out --> remove that
-        for (std::list<AmbientSound*>::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)
+        for (std::list<SmartPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)
         {
             if (*it == sound)
@@ -484,8 +483,8 @@
     }
 
-    void SoundManager::fadeOut(AmbientSound* sound)
+    void SoundManager::fadeOut(const SmartPtr<AmbientSound>& sound)
     {
         // If we're already fading in --> remove that
-        for (std::list<AmbientSound*>::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)
+        for (std::list<SmartPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)
         {
             if (*it == sound)
@@ -510,5 +509,5 @@
         
         // FADE IN
-        for (std::list<AmbientSound*>::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )
+        for (std::list<SmartPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )
         {
             if ((*it)->getVolume() + this->crossFadeStep_*dt > 1.0f)
@@ -525,5 +524,5 @@
 
         // FADE OUT
-        for (std::list<AmbientSound*>::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )
+        for (std::list<SmartPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )
         {
             if ((*it)->getVolume() - this->crossFadeStep_*dt < 0.0f)
Index: code/branches/presentation2/src/orxonox/sound/SoundManager.h
===================================================================
--- code/branches/presentation2/src/orxonox/sound/SoundManager.h	(revision 6340)
+++ code/branches/presentation2/src/orxonox/sound/SoundManager.h	(revision 6349)
@@ -40,4 +40,5 @@
 #include "util/Singleton.h"
 #include "core/OrxonoxClass.h"
+#include "core/SmartPtr.h"
 
 // forward declaration
@@ -109,6 +110,6 @@
     private:
         void processCrossFading(float dt);
-        void fadeIn(AmbientSound* sound);
-        void fadeOut(AmbientSound* sound);
+        void fadeIn(const SmartPtr<AmbientSound>& sound);
+        void fadeOut(const SmartPtr<AmbientSound>& sound);
 
         void checkFadeStepValidity();
@@ -133,6 +134,6 @@
 
         float crossFadeStep_;       //!< Absolute change per second (0.1 means 10% of the nominal volume) for cross fading
-        std::list<AmbientSound*> fadeInList_;
-        std::list<AmbientSound*> fadeOutList_;
+        std::list<SmartPtr<AmbientSound> > fadeInList_;
+        std::list<SmartPtr<AmbientSound> > fadeOutList_;
 
         float soundVolume_;
