Index: include/v8-util.h |
diff --git a/include/v8-util.h b/include/v8-util.h |
index 1ee1c721349bbcc7f3c18c82de0154ed43d4ab6c..21990a8fd9c681c91c2599ab40434520a22b3a78 100644 |
--- a/include/v8-util.h |
+++ b/include/v8-util.h |
@@ -134,6 +134,9 @@ class DefaultGlobalMapTraits : public StdMapTraits<K, V> { |
} |
static void DisposeCallbackData(WeakCallbackInfoType* data) {} |
static void Dispose(Isolate* isolate, Global<V> value, K key) {} |
+ static void DisposeWeak(Isolate* isolate, |
+ const WeakCallbackInfo<WeakCallbackInfoType>& data, |
+ K key) {} |
private: |
template <typename T> |
@@ -319,6 +322,8 @@ class PersistentValueMapBase { |
return p.Pass(); |
} |
+ void RemoveWeak(const K& key) { Traits::Remove(&impl_, key); } |
+ |
private: |
PersistentValueMapBase(PersistentValueMapBase&); |
void operator=(PersistentValueMapBase&); |
@@ -469,8 +474,8 @@ class GlobalValueMap : public PersistentValueMapBase<K, V, Traits> { |
GlobalValueMap<K, V, Traits>* persistentValueMap = |
Traits::MapFromWeakCallbackInfo(data); |
K key = Traits::KeyFromWeakCallbackInfo(data); |
- Traits::Dispose(data.GetIsolate(), persistentValueMap->Remove(key).Pass(), |
- key); |
+ persistentValueMap->RemoveWeak(key); |
+ Traits::DisposeWeak(data.GetIsolate(), data, key); |
Traits::DisposeCallbackData(data.GetParameter()); |
} |
} |