diff --git a/src/node.cc b/src/node.cc index 34e49e98d4..f71c2714a8 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.