From b70894b9505f7aaec7afb7a24cc46649f52be63d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 12 Jun 2023 09:36:49 -0400 Subject: [PATCH 1/2] ParallelProgressDialog: Initialize all data members Ensures we always have a deterministic state. --- Source/Core/DolphinQt/QtUtils/ParallelProgressDialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/QtUtils/ParallelProgressDialog.h b/Source/Core/DolphinQt/QtUtils/ParallelProgressDialog.h index 4335ec4b9f..3d8d92344c 100644 --- a/Source/Core/DolphinQt/QtUtils/ParallelProgressDialog.h +++ b/Source/Core/DolphinQt/QtUtils/ParallelProgressDialog.h @@ -126,6 +126,6 @@ private: QProgressDialog m_dialog; Common::Flag m_was_cancelled; - int m_last_received_progress; + int m_last_received_progress = 0; bool m_is_setting_value = false; }; From 9c0cd5c81a3658a52da0d1d0ef9d40b016b26d12 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 12 Jun 2023 09:38:08 -0400 Subject: [PATCH 2/2] ParallelProgressDialog: Mark WasCanceled() as const This doesn't alter any class state. --- Source/Core/DolphinQt/QtUtils/ParallelProgressDialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/QtUtils/ParallelProgressDialog.h b/Source/Core/DolphinQt/QtUtils/ParallelProgressDialog.h index 3d8d92344c..573c2ed2d2 100644 --- a/Source/Core/DolphinQt/QtUtils/ParallelProgressDialog.h +++ b/Source/Core/DolphinQt/QtUtils/ParallelProgressDialog.h @@ -45,7 +45,7 @@ public: void SetValue(int progress) { emit SetValueSignal(progress); } // Can be called from any thread - bool WasCanceled() { return m_was_cancelled.IsSet(); } + bool WasCanceled() const { return m_was_cancelled.IsSet(); } signals: void CancelSignal();