diff --git a/src/node.cc b/src/node.cc index 2068488b9ea7b7..12219b026d63b7 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3226,6 +3226,13 @@ void LoadEnvironment(Environment* env) { f->Call(global, 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 ef1f629d20aa0e..f70b5f8e784382 100644 --- a/src/node.h +++ b/src/node.h @@ -196,6 +196,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.