Skip to content

Commit

Permalink
fix(vt): correctly scope lock guard + add missing iterate-to-next in …
Browse files Browse the repository at this point in the history
…for loop
  • Loading branch information
GwnDaan committed Mar 15, 2024
1 parent 6edc33d commit 704ee84
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion isobus/src/isobus_virtual_terminal_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4503,11 +4503,11 @@ namespace isobus
return true;
}

LOCK_GUARD(Mutex, commandQueueMutex);
if (replace && replace_command(data))
{
return true;
}
LOCK_GUARD(Mutex, commandQueueMutex);
commandQueue.emplace_back(data);
return true;
}
Expand All @@ -4531,6 +4531,10 @@ namespace isobus
it = commandQueue.erase(it);
}
}
else
{
it++;
}
}
return alreadyReplaced;
}
Expand Down

0 comments on commit 704ee84

Please sign in to comment.