Merge pull request #12404 from lioncash/guard

CheatSearchWidget: Make use of CPUThreadGuard parameter in UpdateTableRows()
This commit is contained in:
Tilka 2023-12-12 22:18:26 +00:00 committed by GitHub
commit 8c99198251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -388,15 +388,10 @@ bool CheatSearchWidget::UpdateTableRows(const Core::CPUThreadGuard& guard, const
{
const bool update_status_text = source == UpdateSource::User;
std::unique_ptr<Cheats::CheatSearchSessionBase> tmp =
m_session->ClonePartial(begin_index, end_index);
auto tmp = m_session->ClonePartial(begin_index, end_index);
tmp->SetFilterType(Cheats::FilterType::DoNotFilter);
const Cheats::SearchErrorCode error_code = [&tmp] {
Core::CPUThreadGuard guard(Core::System::GetInstance());
return tmp->RunSearch(guard);
}();
const Cheats::SearchErrorCode error_code = tmp->RunSearch(guard);
if (error_code != Cheats::SearchErrorCode::Success)
{
if (update_status_text)