No longer crashes when two DAQ files opened.

This commit is contained in:
Chris Esposito 2017-12-28 22:14:47 +11:00
parent 370857eff4
commit e957460134
1 changed files with 8 additions and 1 deletions

View File

@ -1277,6 +1277,9 @@ void isoDriver::serialNeedsDisabling(int channel){
//Thank you https://stackoverflow.com/questions/27318631/parsing-through-a-csv-file-in-qt
void isoDriver::loadFileBuffer(QFile *fileToLoad){
//Delete the current buffer if it exists
disableFileMode();
if(internalBufferFile != NULL){
delete internalBufferFile;
}
@ -1398,6 +1401,8 @@ void isoDriver::loadFileBuffer(QFile *fileToLoad){
tempList.clear();
}
fileToLoad->close();
qDebug() << "Initialising timer";
//Initialise the file timer.
if (fileTimer != NULL){
@ -1436,7 +1441,9 @@ void isoDriver::enableFileMode(){
void isoDriver::disableFileMode(){
fileModeEnabled = false;
showRealtimeButton(false);
fileTimer->stop();
if(fileTimer != NULL){
fileTimer->stop();
}
//Shrink screen back, if necessary.
double mws = fileModeEnabled ? daq_maxWindowSize : ((double)MAX_WINDOW_SIZE);