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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jun 3 17:55:07 CEST 2007


Revision: 27065
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27065&view=rev
Author:   fingolfin
Date:     2007-06-03 08:55:07 -0700 (Sun, 03 Jun 2007)

Log Message:
-----------
Fixed serious memory leak in AGOS engine (sound looping code was leaking)

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

Modified: scummvm/trunk/engines/agos/sound.cpp
===================================================================
--- scummvm/trunk/engines/agos/sound.cpp	2007-06-03 15:50:25 UTC (rev 27064)
+++ scummvm/trunk/engines/agos/sound.cpp	2007-06-03 15:55:07 UTC (rev 27065)
@@ -72,6 +72,7 @@
 	uint _loopSound;
 public:
 	LoopingAudioStream(BaseSound *parent, uint sound, uint loopSound, bool loop);
+	~LoopingAudioStream();
 	int readBuffer(int16 *buffer, const int numSamples);
 	bool isStereo() const { return _stream ? _stream->isStereo() : 0; }
 	bool endOfData() const;
@@ -87,6 +88,10 @@
 	_stream = _parent->makeAudioStream(sound);
 }
 
+LoopingAudioStream::~LoopingAudioStream() {
+	delete _stream;
+}
+
 int LoopingAudioStream::readBuffer(int16 *buffer, const int numSamples) {
 	if (!_loop) {
 		return _stream->readBuffer(buffer, numSamples);


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