mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-10 06:01:52 +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) {
|
void LocationRedirector::EraseRedirection(ncm::ProgramId program_id) {
|
||||||
/* Remove any redirections with a matching 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) {
|
if (it->GetProgramId() == program_id) {
|
||||||
auto *redirection = std::addressof(*it);
|
auto *redirection = std::addressof(*it);
|
||||||
m_redirection_list.erase(it);
|
it = m_redirection_list.erase(it);
|
||||||
delete redirection;
|
delete redirection;
|
||||||
break;
|
break;
|
||||||
|
} else {
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationRedirector::ClearRedirections(u32 flags) {
|
void LocationRedirector::ClearRedirections(u32 flags) {
|
||||||
/* Remove any redirections with matching 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) {
|
if ((it->GetFlags() & flags) == flags) {
|
||||||
auto *redirection = std::addressof(*it);
|
auto *redirection = std::addressof(*it);
|
||||||
it = m_redirection_list.erase(it);
|
it = m_redirection_list.erase(it);
|
||||||
delete redirection;
|
delete redirection;
|
||||||
} else {
|
} else {
|
||||||
it++;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue