Skip to content

Commit

Permalink
Fix failed assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Aug 1, 2023
1 parent 10a54db commit 53eb2df
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ void CommandScheduler::Cancel(Command* command) {
if (m_impl->cancelling.contains(command)) {
return;
}
auto find = m_impl->scheduledCommands.find(command);
if (find == m_impl->scheduledCommands.end()) {
if (!IsScheduled(command)) {
return;
}
m_impl->cancelling.insert(command);
Expand All @@ -355,7 +354,7 @@ void CommandScheduler::Cancel(Command* command) {
for (auto&& action : m_impl->interruptActions) {
action(*command);
}
m_impl->scheduledCommands.erase(*find);
m_impl->scheduledCommands.erase(command);
for (auto&& requirement : m_impl->requirements) {
if (requirement.second == command) {
m_impl->requirements.erase(requirement.first);
Expand Down

0 comments on commit 53eb2df

Please sign in to comment.