closeSession: actually remove elements from sessions_ am: 0d97a2bd57
Original change: https://android-review.googlesource.com/c/device/google/tangorpro/+/2758445 Change-Id: I3d57e1f9b803ca1207dc265f9b847b7644320bf5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
16578e55d0
1 changed files with 5 additions and 4 deletions
|
@ -29,10 +29,11 @@ std::vector<uint8_t> SessionLibrary::createSession() {
|
|||
|
||||
void SessionLibrary::closeSession(const std::vector<uint8_t>& session) {
|
||||
std::lock_guard<std::mutex> guard(session_lock_);
|
||||
std::remove_if(sessions_.begin(), sessions_.end(),
|
||||
[&session](const std::vector<uint8_t>& e) {
|
||||
return std::equal(e.begin(), e.end(), session.begin());
|
||||
});
|
||||
sessions_.erase(std::remove_if(sessions_.begin(), sessions_.end(),
|
||||
[&session](const std::vector<uint8_t>& e) {
|
||||
return std::equal(e.begin(), e.end(), session.begin());
|
||||
}),
|
||||
sessions_.end());
|
||||
}
|
||||
|
||||
} // namespace castkeydrm
|
Loading…
Add table
Add a link
Reference in a new issue