summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCheng Zhao <zcbenz@gmail.com>2015-09-28 21:42:25 +0800
committerBen Noordhuis <info@bnoordhuis.nl>2016-05-19 12:58:58 +0200
commit2ab75b7a427a3266316ceb89e69aec9c7f62ac3c (patch)
tree7eb8d3dbd45006cbbb3382d6b846c01cae48ed31 /src
parentfe77de196c0fb98eb7d57402946fb295663f886f (diff)
downloadandroid-node-v8-2ab75b7a427a3266316ceb89e69aec9c7f62ac3c.tar.gz
android-node-v8-2ab75b7a427a3266316ceb89e69aec9c7f62ac3c.tar.bz2
android-node-v8-2ab75b7a427a3266316ceb89e69aec9c7f62ac3c.zip
src: add node::FreeEnvironment public API
Since debugger::Agent's interface is not exported, third party embedders will have linking errors if they call Environment's destructor directly. PR-URL: https://github.com/nodejs/node/pull/3098 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src')
-rw-r--r--src/node.cc7
-rw-r--r--src/node.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/node.cc b/src/node.cc
index 075fd1b81a..e71c6a9f0a 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -3386,6 +3386,13 @@ void LoadEnvironment(Environment* env) {
f->Call(Null(env->isolate()), 1, &arg);
}
+
+void FreeEnvironment(Environment* env) {
+ CHECK_NE(env, nullptr);
+ env->Dispose();
+}
+
+
static void PrintHelp();
static bool ParseDebugOpt(const char* arg) {
diff --git a/src/node.h b/src/node.h
index 529ee75f27..42c5ac59d7 100644
--- a/src/node.h
+++ b/src/node.h
@@ -200,6 +200,7 @@ NODE_EXTERN Environment* CreateEnvironment(v8::Isolate* isolate,
int exec_argc,
const char* const* exec_argv);
NODE_EXTERN void LoadEnvironment(Environment* env);
+NODE_EXTERN void FreeEnvironment(Environment* env);
// NOTE: Calling this is the same as calling
// CreateEnvironment() + LoadEnvironment() from above.