Index: include/v8-util.h |
diff --git a/include/v8-util.h b/include/v8-util.h |
index c58f4cab5c16018839f95bfb32d9879639d8b875..86549252b836bbad8c89d8aa667245c683b4bbff 100644 |
--- a/include/v8-util.h |
+++ b/include/v8-util.h |
@@ -300,6 +300,7 @@ class PersistentValueMap { |
K key = Traits::KeyFromWeakCallbackData(data); |
Traits::Dispose(data.GetIsolate(), |
persistentValueMap->Remove(key).Pass(), key); |
+ Traits::DisposeCallbackData(data.GetParameter()); |
} |
} |
@@ -337,7 +338,7 @@ class PersistentValueMap { |
static UniquePersistent<V> Release(PersistentContainerValue v) { |
UniquePersistent<V> p; |
p.val_ = FromVal(v); |
- if (Traits::kCallbackType != kNotWeak && !p.IsEmpty()) { |
+ if (Traits::kCallbackType != kNotWeak && p.IsWeak()) { |
Traits::DisposeCallbackData( |
p.template ClearWeak<typename Traits::WeakCallbackDataType>()); |
} |