Fix some array deletion stuff

This commit is contained in:
Mark Watkins 2016-04-17 00:37:17 +10:00
parent 9f271c7e79
commit 4a814e23a7
2 changed files with 4 additions and 4 deletions

View File

@ -111,7 +111,7 @@ void HighPass(char * data, int samples, float cutoff, float dt)
for (int i=0; i< samples; ++i) { for (int i=0; i< samples; ++i) {
data[i] = Y[i]; data[i] = Y[i];
} }
delete Y; delete [] Y;
} }
int WeinmannLoader::Open(QString path) int WeinmannLoader::Open(QString path)

View File

@ -231,7 +231,7 @@ bool compressFile(QString inpath, QString outpath)
char *buf = new char [size]; char *buf = new char [size];
if (!f.read(buf, size)) { if (!f.read(buf, size)) {
delete buf; delete [] buf;
qDebug() << "compressFile() Couldn't read all of" << inpath; qDebug() << "compressFile() Couldn't read all of" << inpath;
return false; return false;
} }
@ -242,13 +242,13 @@ bool compressFile(QString inpath, QString outpath)
//gzbuffer(gz,65536*2); //gzbuffer(gz,65536*2);
if (!gz) { if (!gz) {
qDebug() << "compressFile() Couldn't open" << outpath << "for writing"; qDebug() << "compressFile() Couldn't open" << outpath << "for writing";
delete buf; delete [] buf;
return false; return false;
} }
gzwrite(gz, buf, size); gzwrite(gz, buf, size);
gzclose(gz); gzclose(gz);
delete buf; delete [] buf;
return true; return true;
} }