The destructor does that. Double disposing broke a bunch of tests.
________________________________
From: Trevor Norris<mailto:notifications@github.com>
Sent: ý8/ý27/ý2013 17:46
To: joyent/node<mailto:node@noreply.github.com>
Cc: Domenic Denicola<mailto:domenic@domenicdenicola.com>
Subject: Re: [node] vm: remove useless ObjectWrap, fix memory leak, prevent double-contextifying. (#6117)


In src/node_contextify.cc:

>
>      Local<String> hidden_name =
>          FIXED_ONE_BYTE_STRING(node_isolate, "_contextifyHidden");
> -    sandbox->SetHiddenValue(hidden_name, contextify_context_object);
> +
> +    args.GetReturnValue().Set(!sandbox->GetHiddenValue(hidden_name).IsEmpty());
> +  }
> +
> +
> +  static void SandboxFreeCallback(Isolate* isolate,
> +                                  Persistent<Object>* target,
> +                                  ContextifyContext* context) {
> +    delete context;


Why don't you have to (*target).Dispose()?

—
Reply to this email directly or view it on GitHub<https://github.com/joyent/node/pull/6117/files#r6019430>.