fix dumpStr faults

This commit is contained in:
Phil Olynyk 2019-09-22 17:22:48 -04:00
parent 47719a4d09
commit d74d4fc1e8
2 changed files with 7 additions and 3 deletions

View File

@ -59,7 +59,7 @@ QByteArray * EDFInfo::Open(const QString & name)
// }
fi.close();
if (fileData->size() <= EDFHeaderSize) {
delete fileData;
fileData->clear();
qDebug() << "EDFInfo::Open() File too short " << name;
sleep(1);
return nullptr;

View File

@ -121,6 +121,10 @@ int main(int argc, char *argv[]) {
if (lastSig == 0 )
lastSig = str.GetNumSignals();
if (((first > 0)&&(last == 0)) || last > size)
last = size;
date = date.addDays(first);
// For each data record, representing 1 day each
for (int rec = first; rec < last+1; ++rec, date = date.addDays(1)) {
qDebug() << "Record no. " << rec << " Date: " << date.toString() ;
@ -155,8 +159,8 @@ int main(int argc, char *argv[]) {
}
}
}
qDebug() << "Deleting the edf object";
delete &str;
// qDebug() << "Deleting the edf object";
// delete &str;
QThread::sleep(1);
qDebug() << "Done";
}