Browse Source

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>
v6.x
Cheng Zhao 9 years ago
committed by Jeremiah Senkpiel
parent
commit
2a8bd35bac
  1. 7
      src/node.cc
  2. 1
      src/node.h

7
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) {

1
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.

Loading…
Cancel
Save