Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
zcbenz committed Sep 28, 2015
commit ea932f3bbfe3671e267f571f286ed77d50c9f08c
7 changes: 7 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3014,6 +3014,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) {
Expand Down
1 change: 1 addition & 0 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down