Diff of /branches/AudioEngine/xbmc/cores/AudioEngine/Engines/PulseAE.cpp [r35739] .. [r35740] Maximize Restore

  Switch to side-by-side view

--- a/branches/AudioEngine/xbmc/cores/AudioEngine/Engines/PulseAE.cpp
+++ b/branches/AudioEngine/xbmc/cores/AudioEngine/Engines/PulseAE.cpp
@@ -180,18 +180,25 @@
 
 IAESound *CPulseAE::GetSound(CStdString file)
 {
+  /* see if we have a valid sound */
+  std::map<const CStdString, CPulseAESound*>::iterator itt = m_sounds.find(file);
+  if (itt != m_sounds.end())
+    return itt->second;
+
   CPulseAESound *sound = new CPulseAESound(file, m_Context, m_MainLoop);
   if (!sound->Initialize())
   {
     delete sound;
     return NULL;
   }
+
+  m_sounds[file] = sound;
   return sound;
 }
 
 void CPulseAE::FreeSound(IAESound *sound)
 {
-  delete (CPulseAESound*)sound;
+  //delete (CPulseAESound*)sound;
 }
 
 void CPulseAE::GarbageCollect()