Skip to content

Commit

Permalink
No longer crashes when two DAQ files opened.
Browse files Browse the repository at this point in the history
  • Loading branch information
EspoTek committed Dec 28, 2017
1 parent 370857e commit e957460
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Desktop_Interface/isodriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -1398,6 +1401,8 @@ void isoDriver::loadFileBuffer(QFile *fileToLoad){
tempList.clear();
}

fileToLoad->close();

qDebug() << "Initialising timer";
//Initialise the file timer.
if (fileTimer != NULL){
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e957460

Please sign in to comment.