@@ -377,7 +377,7 @@ void MainWindow::slotProgVerifyCompleted(quint64 readBytes)
377377
378378 setProgress (100 );
379379 workFile.close ();
380- buffer.clear ();
380+ buffer.buf . clear ();
381381
382382 qInfo () << readBytes << " bytes read. Verify end." ;
383383}
@@ -390,9 +390,10 @@ void MainWindow::slotProgVerifyProgress(quint64 progress)
390390 setProgress (progressPercent);
391391
392392 QVector<uint8_t > cmpBuffer;
393- cmpBuffer.resize (buffer.size ());
393+ buffer.mutex .lock ();
394+ cmpBuffer.resize (buffer.buf .size ());
394395
395- qint64 readSize = workFile.read ((char *)cmpBuffer.data (), buffer.size ());
396+ qint64 readSize = workFile.read ((char *)cmpBuffer.data (), buffer.buf . size ());
396397
397398 if (readSize < 0 )
398399 {
@@ -405,7 +406,7 @@ void MainWindow::slotProgVerifyProgress(quint64 progress)
405406
406407 for (uint32_t i = 0 ; i < readSize; i++)
407408 {
408- if (cmpBuffer.at (i) != buffer.at (i))
409+ if (cmpBuffer.at (i) != buffer.buf . at (i))
409410 {
410411 uint64_t block = progress / ui->blockSizeValueLabel ->text ().toULongLong (nullptr , 16 )
411412 + ui->firstSpinBox ->text ().toULongLong (nullptr , 10 ) - 1 ;
@@ -419,7 +420,8 @@ void MainWindow::slotProgVerifyProgress(quint64 progress)
419420 }
420421 }
421422
422- buffer.clear ();
423+ buffer.buf .clear ();
424+ buffer.mutex .unlock ();
423425}
424426
425427void MainWindow::slotProgVerify ()
@@ -486,7 +488,7 @@ void MainWindow::slotProgVerify()
486488 ui->filePathLineEdit ->setDisabled (true );
487489 ui->selectFilePushButton ->setDisabled (true );
488490
489- buffer.clear ();
491+ buffer.buf . clear ();
490492
491493 prog->readChip (&buffer, start_address, areaSize, true );
492494}
0 commit comments