lr: fix EraseRedirection hang introduced by refactoring

This commit is contained in:
Michael Scire 2021-10-18 11:00:55 -07:00
parent 889d843718
commit 799a9a5f98

View file

@ -86,25 +86,27 @@ namespace ams::lr {
void LocationRedirector::EraseRedirection(ncm::ProgramId program_id) {
/* Remove any redirections with a matching program id. */
for (auto it = m_redirection_list.begin(); it != m_redirection_list.end();) {
for (auto it = m_redirection_list.begin(); it != m_redirection_list.end(); /* ... */) {
if (it->GetProgramId() == program_id) {
auto *redirection = std::addressof(*it);
m_redirection_list.erase(it);
it = m_redirection_list.erase(it);
delete redirection;
break;
} else {
++it;
}
}
}
void LocationRedirector::ClearRedirections(u32 flags) {
/* Remove any redirections with matching flags. */
for (auto it = m_redirection_list.begin(); it != m_redirection_list.end();) {
for (auto it = m_redirection_list.begin(); it != m_redirection_list.end(); /* ... */) {
if ((it->GetFlags() & flags) == flags) {
auto *redirection = std::addressof(*it);
it = m_redirection_list.erase(it);
delete redirection;
} else {
it++;
++it;
}
}
}