We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22daf95 commit 3c418d9Copy full SHA for 3c418d9
1 file changed
src/node_contextify.cc
@@ -255,24 +255,21 @@ void ContextifyContext::MakeContext(const FunctionCallbackInfo<Value>& args) {
255
options.allow_code_gen_wasm = args[4].As<Boolean>();
256
257
TryCatchScope try_catch(env);
258
- ContextifyContext* context = new ContextifyContext(env, sandbox, options);
+ auto context_ptr = std::make_unique<ContextifyContext>(env, sandbox, options);
259
260
if (try_catch.HasCaught()) {
261
if (!try_catch.HasTerminated())
262
try_catch.ReThrow();
263
- delete context;
264
return;
265
}
266
267
- if (context->context().IsEmpty()) {
268
+ if (context_ptr->context().IsEmpty())
269
270
- }
271
272
sandbox->SetPrivate(
273
env->context(),
274
env->contextify_context_private_symbol(),
275
- External::New(env->isolate(), context));
+ External::New(env->isolate(), context_ptr.release()));
276
277
278
0 commit comments