[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.63,1.64

Oliver Kiehl olki at users.sourceforge.net
Sat Nov 9 14:17:01 CET 2002


Update of /cvsroot/scummvm/scummvm/simon
In directory usw-pr-cvs1:/tmp/cvs-serv18175

Modified Files:
	simon.cpp 
Log Message:
fixed some memory leaks


Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- simon.cpp	8 Nov 2002 22:06:03 -0000	1.63
+++ simon.cpp	9 Nov 2002 22:16:07 -0000	1.64
@@ -3280,6 +3280,9 @@
 	if (_game == GAME_SIMON1WIN) { 			/* simon 1 win */
 		uint32 size;
 
+		if (_effects_offsets)
+			free(_effects_offsets);
+
 		if (_effects_file->isOpen() == true)
 			_effects_file->close();
 
@@ -4871,7 +4874,8 @@
 	byte *buffer = (byte *)malloc(size);
 	sound_file->read(buffer, size);
 
-	_mixer->playRaw(sound_handle, buffer, size, samples_per_sec, SoundMixer::FLAG_UNSIGNED);
+	_mixer->playRaw(sound_handle, buffer, size, samples_per_sec,
+			SoundMixer::FLAG_UNSIGNED|SoundMixer::FLAG_AUTOFREE);
 }
 
 void SimonState::playWav(File *sound_file, uint32 *offsets, uint sound, PlayingSoundHandle *sound_handle)
@@ -4904,7 +4908,7 @@
 	sound_file->read(buffer, data[1]);
 
 	_mixer->playRaw(sound_handle, buffer, data[1], READ_LE_UINT32(&wave_hdr.samples_per_sec),
-										 SoundMixer::FLAG_UNSIGNED);
+			SoundMixer::FLAG_UNSIGNED|SoundMixer::FLAG_AUTOFREE);
 }
 
 void SimonState::playVoice(uint voice)





More information about the Scummvm-git-logs mailing list