Skip to content

Commit

Permalink
src: add node::FreeEnvironment public API
Browse files Browse the repository at this point in the history
Since debugger::Agent's interface is not exported, third party embedders
will have linking errors if they call Environment's destructor directly.

PR-URL: #3098
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
zcbenz authored and Myles Borins committed Jul 14, 2016
1 parent 01b314d commit b21d145
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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

0 comments on commit b21d145

Please sign in to comment.