Index: src/natives-external.cc |
diff --git a/src/natives-external.cc b/src/natives-external.cc |
index e601808fe8182055683d32133081b36e46c9938f..109f9c5f47bfe14cf25a69365502ac1ef7993df7 100644 |
--- a/src/natives-external.cc |
+++ b/src/natives-external.cc |
@@ -132,6 +132,10 @@ class NativesHolder { |
DCHECK(store); |
holder_ = store; |
} |
+ static void Dispose() { |
+ DCHECK(holder_); |
+ delete holder_; |
+ } |
private: |
static NativesStore* holder_; |
@@ -157,6 +161,15 @@ void SetNativesFromFile(StartupData* natives_blob) { |
} |
+/** |
+ * Release memory allocated by SetNativesFromFile. |
+ */ |
+void DisposeNatives() { |
+ NativesHolder<CORE>::Dispose(); |
+ NativesHolder<EXPERIMENTAL>::Dispose(); |
+} |
+ |
+ |
// Implement NativesCollection<T> bsaed on NativesHolder + NativesStore. |
// |
// (The callers expect a purely static interface, since this is how the |