fix
authorMatthias Braun <matze@braunis.de>
Fri, 26 May 2006 17:40:37 +0000 (17:40 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 26 May 2006 17:40:37 +0000 (17:40 +0000)
SVN-Revision: 3596

src/audio/sound_manager.cpp
src/badguy/willowisp.hpp

index 0c77b99..12e6200 100644 (file)
@@ -173,8 +173,8 @@ SoundManager::play(const std::string& filename, const Vector& pos)
     return;
   
   try {
-    OpenALSoundSource* source 
-      = static_cast<OpenALSoundSource*> (create_sound_source(filename));
+    std::auto_ptr<OpenALSoundSource> source 
+      (static_cast<OpenALSoundSource*> (create_sound_source(filename)));
     
     if(pos == Vector(-1, -1)) {
       source->set_rollof_factor(0);
@@ -182,7 +182,7 @@ SoundManager::play(const std::string& filename, const Vector& pos)
       source->set_position(pos);
     }
     source->play();
-    sources.push_back(source);
+    sources.push_back(source.release());
   } catch(std::exception& e) {
     log_warning << "Couldn't play sound " << filename << ": " << e.what() << std::endl;
   }
index 00cc4c9..ced7230 100644 (file)
@@ -22,7 +22,6 @@
 #define __WILLOWISP_H__
 
 #include "badguy.hpp"
-#include "audio/managed_sound_source.hpp"
 
 class WillOWisp : public BadGuy
 {