Use DoubleIDWeakMap for |rendererFunctions|

This commit is contained in:
Cheng Zhao 2016-05-11 20:40:48 +09:00
parent 49ac160ff7
commit 759a46f3d6
3 changed files with 54 additions and 16 deletions

View file

@ -70,10 +70,8 @@ class KeyWeakMap {
// Remove object with |key| in the WeakMap.
void Remove(const K& key) {
auto iter = map_.find(key);
if (iter == map_.end()) {
LOG(WARNING) << "Removing unexist object with ID " << key;
if (iter == map_.end())
return;
}
iter->second.second->ClearWeak();
map_.erase(iter);