contextify: dealloc only after global and sandbox
authorFedor Indutny <fedor.indutny@gmail.com>
Thu, 12 Sep 2013 13:51:55 +0000 (17:51 +0400)
committerFedor Indutny <fedor.indutny@gmail.com>
Thu, 12 Sep 2013 15:40:43 +0000 (19:40 +0400)
commit3d4c663ee68326990e0732a4aa76445688e1064e
tree7021efcda4d4bb5653e4205f3d51ec8bb3d72c58
parent59dac01e4eaebd01714b6640ae2cd656796147fb
contextify: dealloc only after global and sandbox

Functions created using: `vm.runInNewContext('(function() { })')` will
reference only `proxy_global_` object and not `sandbox_`. Thus in case,
where there're no references to sandbox (such as in example above),
`ContextifyContext` will be destroyed and use-after-free might happen.
src/node_contextify.cc
test/simple/test-vm-run-in-new-context.js