From 4a814e23a7a064c991c9639bf6c89d488e0db539 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sun, 17 Apr 2016 00:37:17 +1000 Subject: [PATCH] Fix some array deletion stuff --- sleepyhead/SleepLib/loader_plugins/weinmann_loader.cpp | 2 +- sleepyhead/SleepLib/machine_loader.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sleepyhead/SleepLib/loader_plugins/weinmann_loader.cpp b/sleepyhead/SleepLib/loader_plugins/weinmann_loader.cpp index f4d53274..f4a6cf60 100644 --- a/sleepyhead/SleepLib/loader_plugins/weinmann_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/weinmann_loader.cpp @@ -111,7 +111,7 @@ void HighPass(char * data, int samples, float cutoff, float dt) for (int i=0; i< samples; ++i) { data[i] = Y[i]; } - delete Y; + delete [] Y; } int WeinmannLoader::Open(QString path) diff --git a/sleepyhead/SleepLib/machine_loader.cpp b/sleepyhead/SleepLib/machine_loader.cpp index 8e10f8cb..9a695164 100644 --- a/sleepyhead/SleepLib/machine_loader.cpp +++ b/sleepyhead/SleepLib/machine_loader.cpp @@ -231,7 +231,7 @@ bool compressFile(QString inpath, QString outpath) char *buf = new char [size]; if (!f.read(buf, size)) { - delete buf; + delete [] buf; qDebug() << "compressFile() Couldn't read all of" << inpath; return false; } @@ -242,13 +242,13 @@ bool compressFile(QString inpath, QString outpath) //gzbuffer(gz,65536*2); if (!gz) { qDebug() << "compressFile() Couldn't open" << outpath << "for writing"; - delete buf; + delete [] buf; return false; } gzwrite(gz, buf, size); gzclose(gz); - delete buf; + delete [] buf; return true; }