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 b21d145

Browse filesBrowse files
zcbenzMyles Borins
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 01b314d commit b21d145
Copy full SHA for b21d145

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
@@ -3226,6 +3226,13 @@ void LoadEnvironment(Environment* env) {
32263226
f->Call(global, 1, &arg);
32273227
}
32283228

3229+
3230+
void FreeEnvironment(Environment* env) {
3231+
CHECK_NE(env, nullptr);
3232+
env->Dispose();
3233+
}
3234+
3235+
32293236
static void PrintHelp();
32303237

32313238
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
@@ -196,6 +196,7 @@ NODE_EXTERN Environment* CreateEnvironment(v8::Isolate* isolate,
196196
int exec_argc,
197197
const char* const* exec_argv);
198198
NODE_EXTERN void LoadEnvironment(Environment* env);
199+
NODE_EXTERN void FreeEnvironment(Environment* env);
199200

200201
// NOTE: Calling this is the same as calling
201202
// 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.