[Scummvm-cvs-logs] SF.net SVN: scummvm:[50762] scummvm/trunk/engines/mohawk/sound.cpp

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Fri Jul 9 18:53:51 CEST 2010


Revision: 50762
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50762&view=rev
Author:   mthreepwood
Date:     2010-07-09 16:53:50 +0000 (Fri, 09 Jul 2010)

Log Message:
-----------
Fix some other valgrind warnings.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/sound.cpp

Modified: scummvm/trunk/engines/mohawk/sound.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/sound.cpp	2010-07-09 16:53:20 UTC (rev 50761)
+++ scummvm/trunk/engines/mohawk/sound.cpp	2010-07-09 16:53:50 UTC (rev 50762)
@@ -233,6 +233,10 @@
 
 		if (slstRecord.index == index) {
 			playSLST(slstRecord);
+			delete[] slstRecord.sound_ids;
+			delete[] slstRecord.volumes;
+			delete[] slstRecord.balances;
+			delete[] slstRecord.u2;
 			delete slstStream;
 			return;
 		}
@@ -244,6 +248,7 @@
 	}
 
 	delete slstStream;
+
 	// No matching records, assume we need to stop all SLST's
 	stopAllSLST();
 }
@@ -277,8 +282,11 @@
 }
 
 void Sound::stopAllSLST() {
-	for (uint16 i = 0; i < _currentSLSTSounds.size(); i++)
+	for (uint16 i = 0; i < _currentSLSTSounds.size(); i++) {
 		_vm->_mixer->stopHandle(*_currentSLSTSounds[i].handle);
+		delete _currentSLSTSounds[i].handle;
+	}
+
 	_currentSLSTSounds.clear();
 }
 
@@ -314,6 +322,7 @@
 void Sound::stopSLSTSound(uint16 index, bool fade) {
 	// TODO: Fade out, mixer needs to be extended to get volume on a handle
 	_vm->_mixer->stopHandle(*_currentSLSTSounds[index].handle);
+	delete _currentSLSTSounds[index].handle;
 	_currentSLSTSounds.remove_at(index);
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list