From a2edf1cd1608573ccb88e4d701311f5f26148021 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 20 Jan 2010 00:00:50 +0000 Subject: Fixed cppcheck warnings. I usually stay out of backends I can't compile myself but this change seemed obvious enough that it should work. svn-id: r47400 --- backends/platform/ds/arm9/source/ramsave.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'backends/platform/ds/arm9') diff --git a/backends/platform/ds/arm9/source/ramsave.cpp b/backends/platform/ds/arm9/source/ramsave.cpp index ff756205ab..f38e36250e 100644 --- a/backends/platform/ds/arm9/source/ramsave.cpp +++ b/backends/platform/ds/arm9/source/ramsave.cpp @@ -75,7 +75,7 @@ DSSaveFile::~DSSaveFile() { DSSaveFileManager::instance()->flushToSaveRAM(); } if (ownsData) { - delete saveData; + delete[] saveData; } } @@ -98,7 +98,7 @@ bool DSSaveFile::loadFromSaveRAM(vu8* address) { ((char *) (saveData))[t] = *(address + t + sizeof(newSave)); } - if (ownsData) delete this->saveData; + if (ownsData) delete[] this->saveData; save = newSave; saveCompressed = true; this->saveData = saveData; @@ -119,7 +119,7 @@ void DSSaveFile::compress() { - delete saveData; + delete[] saveData; // Make the save smaller saveData = (u8 *) realloc(compBuffer, save.compressedSize); @@ -282,7 +282,7 @@ void DSSaveFile::clearData() { if (saveCompressed) { if (ownsData) { - delete saveData; + delete[] saveData; DSSaveFileManager::instance()->addBytesFree(getRamUsage()); } saveData = new unsigned char[DS_MAX_SAVE_SIZE]; @@ -296,7 +296,7 @@ void DSSaveFile::deleteFile() { if (isValid()) { if (ownsData) { DSSaveFileManager::instance()->addBytesFree(getRamUsage()); - delete saveData; + delete[] saveData; saveData = NULL; } ptr = 0; -- cgit v1.2.3