mirror of
https://github.com/BobTheBlinker/android_device_motorola_sm6375-common.git
synced 2026-10-05 19:31:58 -04:00
sm6375-common: gps: Avoid access of deprecated LocUnorderedSetMap entry
When there is no client listens to some DataItemId, we will remove the map entry. Can't access the deleted entry's iterator anymore. Change-Id: Id64aadebf7362667fbcf0fd5191f888ed9241727 CRs-Fixed: 3886536 (cherry picked from commit 0049d459cc1772f328e29a4c6b6d129af132e7b8)
This commit is contained in:
parent
1e53e4f534
commit
b454b018fd
1 changed files with 5 additions and 2 deletions
|
|
@ -141,8 +141,11 @@ public:
|
|||
unordered_set<KEY>* goneKeys, unordered_set<VAL>* goneVals) {
|
||||
for (auto key : keys) {
|
||||
auto iter = mMap.find(key);
|
||||
if (iter != mMap.end() && trimOrRemove(iter, rVals, goneVals) && nullptr != goneKeys) {
|
||||
goneKeys->insert(iter->first);
|
||||
if (iter != mMap.end()) {
|
||||
KEY goneKey = iter->first;
|
||||
if (trimOrRemove(iter, rVals, goneVals) && nullptr != goneKeys) {
|
||||
goneKeys->insert(goneKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue