[Scummvm-cvs-logs] scummvm master -> 091bcbf3132f5f78e9814577d444458892183aa9

clone2727 clone2727 at gmail.com
Sat Oct 26 16:22:32 CEST 2013


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1b3eee6d78 GRAPHICS: Clarify implicit destroy() usage
091bcbf313 GRAPHICS: Have TGA's loadStream() call destroy()


Commit: 1b3eee6d78438b14b437fa6036ef6a1cf45af578
    https://github.com/scummvm/scummvm/commit/1b3eee6d78438b14b437fa6036ef6a1cf45af578
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2013-10-26T07:21:03-07:00

Commit Message:
GRAPHICS: Clarify implicit destroy() usage

Changed paths:
    graphics/decoders/image_decoder.h



diff --git a/graphics/decoders/image_decoder.h b/graphics/decoders/image_decoder.h
index 49e31c6..a39a9a1 100644
--- a/graphics/decoders/image_decoder.h
+++ b/graphics/decoders/image_decoder.h
@@ -44,6 +44,9 @@ public:
 
 	/**
 	 * Load an image from the specified stream
+	 * 
+	 * loadStream() should implicitly call destroy() to free the memory
+	 * of the last loadStream() call.
 	 *
 	 * @param stream the input stream
 	 * @return whether loading the file succeeded
@@ -54,6 +57,9 @@ public:
 
 	/**
 	 * Destroy this decoder's surface and palette
+	 *
+	 * This should be called by a loadStream() implementation as well
+	 * as the destructor.
 	 */
 	virtual void destroy() = 0;
 


Commit: 091bcbf3132f5f78e9814577d444458892183aa9
    https://github.com/scummvm/scummvm/commit/091bcbf3132f5f78e9814577d444458892183aa9
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2013-10-26T07:21:08-07:00

Commit Message:
GRAPHICS: Have TGA's loadStream() call destroy()

Changed paths:
    graphics/decoders/tga.cpp



diff --git a/graphics/decoders/tga.cpp b/graphics/decoders/tga.cpp
index a9f136d..bc27f18 100644
--- a/graphics/decoders/tga.cpp
+++ b/graphics/decoders/tga.cpp
@@ -50,6 +50,8 @@ void TGADecoder::destroy() {
 }
 
 bool TGADecoder::loadStream(Common::SeekableReadStream &tga) {
+	destroy();
+
 	byte imageType, pixelDepth;
 	bool success;
 	success = readHeader(tga, imageType, pixelDepth);






More information about the Scummvm-git-logs mailing list