Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d8fee36

Browse filesBrowse files
zcbenzFishrock123
authored andcommitted
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: #3098 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent bfcc650 commit d8fee36
Copy full SHA for d8fee36

File tree

Expand file treeCollapse file tree

2 files changed

+8
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-0
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3386,6 +3386,13 @@ void LoadEnvironment(Environment* env) {
33863386
f->Call(Null(env->isolate()), 1, &arg);
33873387
}
33883388

3389+
3390+
void FreeEnvironment(Environment* env) {
3391+
CHECK_NE(env, nullptr);
3392+
env->Dispose();
3393+
}
3394+
3395+
33893396
static void PrintHelp();
33903397

33913398
static bool ParseDebugOpt(const char* arg) {
Collapse file

‎src/node.h‎

Copy file name to clipboardExpand all lines: src/node.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ NODE_EXTERN Environment* CreateEnvironment(v8::Isolate* isolate,
200200
int exec_argc,
201201
const char* const* exec_argv);
202202
NODE_EXTERN void LoadEnvironment(Environment* env);
203+
NODE_EXTERN void FreeEnvironment(Environment* env);
203204

204205
// NOTE: Calling this is the same as calling
205206
// CreateEnvironment() + LoadEnvironment() from above.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.