From f24bae55802716d149a005340afa8f5a729dea99 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Thu, 19 Dec 2024 00:15:42 +0100 Subject: [PATCH] Fix crash because "Stop Recording" could be pressed twice Disable the stop button as soon as it is pressed instead of waiting to do it in the `recordingStopped` function, so it can't be pressed again which caused a crash. The `recordingStopped` function isn't immediately called after pressing stop because perf can take a while to finish after it is asked to terminate (eg: if debuginfod is enabled and has to download symbols, or if the trace is very big). --- src/recordpage.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/recordpage.cpp b/src/recordpage.cpp index a0e9b73b..f9737410 100644 --- a/src/recordpage.cpp +++ b/src/recordpage.cpp @@ -649,6 +649,9 @@ void RecordPage::onStartRecordingButtonClicked(bool checked) break; } } else { + m_updateRuntimeTimer->stop(); + ui->startRecordingButton->setText(tr("Stopping recording...")); + ui->startRecordingButton->setEnabled(false); stopRecording(); } }