mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-17 17:36:44 +00:00
lr: fix EraseRedirection hang introduced by refactoring
This commit is contained in:
parent
889d843718
commit
799a9a5f98
1 changed files with 6 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue