Index: include/v8-util.h |
diff --git a/include/v8-util.h b/include/v8-util.h |
index 21990a8fd9c681c91c2599ab40434520a22b3a78..b01d527754b5ce758d641fadfabc0b7133d92c5f 100644 |
--- a/include/v8-util.h |
+++ b/include/v8-util.h |
@@ -322,7 +322,11 @@ class PersistentValueMapBase { |
return p.Pass(); |
} |
- void RemoveWeak(const K& key) { Traits::Remove(&impl_, key); } |
+ void RemoveWeak(const K& key) { |
+ Global<V> p; |
+ p.val_ = FromVal(Traits::Remove(&impl_, key)); |
+ p.Reset(); |
+ } |
private: |
PersistentValueMapBase(PersistentValueMapBase&); |
@@ -476,7 +480,6 @@ class GlobalValueMap : public PersistentValueMapBase<K, V, Traits> { |
K key = Traits::KeyFromWeakCallbackInfo(data); |
persistentValueMap->RemoveWeak(key); |
Traits::DisposeWeak(data.GetIsolate(), data, key); |
- Traits::DisposeCallbackData(data.GetParameter()); |
} |
} |
}; |