Commit 641d57f 1 parent fe1b96d commit 641d57f Copy full SHA for 641d57f
File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -255,24 +255,21 @@ void ContextifyContext::MakeContext(const FunctionCallbackInfo<Value>& args) {
255
255
options.allow_code_gen_wasm = args[4 ].As <Boolean >();
256
256
257
257
TryCatchScope try_catch (env);
258
- ContextifyContext* context = new ContextifyContext (env, sandbox, options);
258
+ auto context_ptr = std::make_unique< ContextifyContext> (env, sandbox, options);
259
259
260
260
if (try_catch.HasCaught ()) {
261
261
if (!try_catch.HasTerminated ())
262
262
try_catch.ReThrow ();
263
- delete context;
264
263
return ;
265
264
}
266
265
267
- if (context->context ().IsEmpty ()) {
268
- delete context;
266
+ if (context_ptr->context ().IsEmpty ())
269
267
return ;
270
- }
271
268
272
269
sandbox->SetPrivate (
273
270
env->context (),
274
271
env->contextify_context_private_symbol (),
275
- External::New (env->isolate (), context ));
272
+ External::New (env->isolate (), context_ptr. release () ));
276
273
}
277
274
278
275
You can’t perform that action at this time.
0 commit comments