mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 04:42:20 +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) {
|
||||
withWriteLock([&] {
|
||||
auto type = _typeMap.find(uid);
|
||||
if (type != _typeMap.end()) {
|
||||
_picks[type->second].erase(uid);
|
||||
_typeMap.erase(uid);
|
||||
_totalPickCounts[type->second]--;
|
||||
auto typeIt = _typeMap.find(uid);
|
||||
if (typeIt != _typeMap.end()) {
|
||||
_picks[typeIt->second].erase(uid);
|
||||
_totalPickCounts[typeIt->second]--;
|
||||
_typeMap.erase(typeIt);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue