From 16530846acc8a9d0ededdf3de82f11d3260fee87 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Fri, 17 Jul 2009 01:05:13 +0000 Subject: * Renamed BAFile::closeFile() to close() * Fixed leak in BArchive::loadFileDFW() svn-id: r42554 --- engines/draci/barchive.cpp | 4 +++- engines/draci/barchive.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/draci') diff --git a/engines/draci/barchive.cpp b/engines/draci/barchive.cpp index cbe019f8b2..2a27e6a383 100644 --- a/engines/draci/barchive.cpp +++ b/engines/draci/barchive.cpp @@ -375,6 +375,8 @@ BAFile *BArchive::loadFileDFW(unsigned int i) const { assert(len == _files[i]._length && "Uncompressed file not of the expected length"); + delete[] buf; + return _files + i; } @@ -386,7 +388,7 @@ void BArchive::clearCache() { // Delete all cached data for (unsigned int i = 0; i < _fileCount; ++i) { - _files[i].closeFile(); + _files[i].close(); } } diff --git a/engines/draci/barchive.h b/engines/draci/barchive.h index 5a4f5155f7..7d26b65884 100644 --- a/engines/draci/barchive.h +++ b/engines/draci/barchive.h @@ -43,7 +43,7 @@ struct BAFile { byte _stopper; //!< Not used in BAR files, needed for DFW /** Releases the file data (for memory considerations) */ - void closeFile(void) { + void close(void) { delete[] _data; _data = NULL; } -- cgit v1.2.3