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 Fishrock123 committed Jun 27, 2016
1 parent bfcc650 commit d8fee36
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 @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d8fee36

Please sign in to comment.