mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 23:40:11 +02:00
Merge pull request #14220 from SamGondelman/pickFree
Fix PickManager::removePick heap use after free
This commit is contained in:
commit
a2d4c236c1
1 changed files with 5 additions and 5 deletions
|
@ -38,11 +38,11 @@ std::shared_ptr<PickQuery> PickManager::findPick(unsigned int uid) const {
|
||||||
|
|
||||||
void PickManager::removePick(unsigned int uid) {
|
void PickManager::removePick(unsigned int uid) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
auto type = _typeMap.find(uid);
|
auto typeIt = _typeMap.find(uid);
|
||||||
if (type != _typeMap.end()) {
|
if (typeIt != _typeMap.end()) {
|
||||||
_picks[type->second].erase(uid);
|
_picks[typeIt->second].erase(uid);
|
||||||
_typeMap.erase(uid);
|
_totalPickCounts[typeIt->second]--;
|
||||||
_totalPickCounts[type->second]--;
|
_typeMap.erase(typeIt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue