Index: src/sound/jukebox.cpp
===================================================================
--- src/sound/jukebox.cpp	(révision 936)
+++ src/sound/jukebox.cpp	(copie de travail)
@@ -80,6 +80,8 @@
     std::cout << "Opened audio at " << m_config.frequency <<" Hz "<< (audio_format&0xFF) 
 	      <<" bit " << std::endl;
   }
+  Mix_ChannelFinished(JukeBox::EndChunk);
+  
   m_init = true;  
   
   LoadXML("share");
@@ -237,7 +239,19 @@
 
   if (channel == -1) {
 	MSG_DEBUG("jukebox", "Error: Jukebox::PlaySample: %s", Mix_GetError());
+	Mix_FreeChunk(sample);
   }
+  else
+    chunks[channel] = sample;
   return channel;
 }
 
+void JukeBox::EndChunk(int channel)
+{
+	Mix_Chunk* chk = jukebox.chunks[channel];
+
+	if(!chk) return;
+
+	Mix_FreeChunk(chk);
+	jukebox.chunks[channel] = 0;
+}
Index: src/sound/jukebox.h
===================================================================
--- src/sound/jukebox.h	(révision 936)
+++ src/sound/jukebox.h	(copie de travail)
@@ -42,6 +42,8 @@
 
   std::multimap<std::string, std::string> m_soundsamples;
 
+  std::map<int, Mix_Chunk*> chunks;
+
   struct s_m_config{
     bool music;
     bool effects;
@@ -53,6 +55,8 @@
 
   std::set<std::string> m_profiles_loaded;
 
+  static void EndChunk(int channel);
+
 public:
   JukeBox();
   void Init();
