[Scummvm-cvs-logs] CVS: scummvm/simon sound.cpp,1.30,1.31

Travis Howell kirben at users.sourceforge.net
Thu Jul 24 05:06:01 CEST 2003


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv29413/simon

Modified Files:
	sound.cpp 
Log Message:

Check before releasing memory


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/sound.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- sound.cpp	24 Jul 2003 10:20:56 -0000	1.30
+++ sound.cpp	24 Jul 2003 12:05:06 -0000	1.31
@@ -422,6 +422,9 @@
 		}
 	}
 
+	if (_voice)
+		delete _voice;
+
 	_voice = new RawSound(_mixer, file, 0, SOUND_BIG_ENDIAN);
 }
 
@@ -434,6 +437,9 @@
 		if (file->isOpen() == false) {
 			warning("Can't open voice file %s", filename);
 		} else {
+			if (_voice)
+				delete _voice;
+
 			_voice = new WavSound(_mixer, file, _offsets);
 		}
 	}





More information about the Scummvm-git-logs mailing list