summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Laverdet <marcel@laverdet.com>2012-05-04 17:29:42 -0500
committerBen Noordhuis <info@bnoordhuis.nl>2012-05-05 00:56:17 +0200
commitc33d3174b88b86a7fc4c2f48f361b794206cb8aa (patch)
tree4b282755083742d6446639052632f39ca3227e3a /src
parentebbd4039bceb82e47573bdb213d1ec015ad67b61 (diff)
downloadnodejs-c33d3174b88b86a7fc4c2f48f361b794206cb8aa.tar.gz
nodejs-c33d3174b88b86a7fc4c2f48f361b794206cb8aa.tar.bz2
nodejs-c33d3174b88b86a7fc4c2f48f361b794206cb8aa.zip
node: un-revert 9a6012e
The crashes in debug mode after adding Locker are *not* caused by Locker. Locker is merely exposing issues that already existed. Some of these issues have since been fixed in 70635753. This reverts commit 407181538b5193f6810bf06a2056a200265c0e93. This reapplies commit 9a6012edd9330296b7476bc6b7fbda2cd5c8165d. Conflicts: src/node.cc
Diffstat (limited to 'src')
-rw-r--r--src/node.cc48
1 files changed, 27 insertions, 21 deletions
diff --git a/src/node.cc b/src/node.cc
index e8ce6d6f8..ae5328609 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -2858,34 +2858,40 @@ int Start(int argc, char *argv[]) {
// Use copy here as to not modify the original argv:
Init(argc, argv_copy);
- v8::V8::Initialize();
- v8::HandleScope handle_scope;
+ V8::Initialize();
+ {
+ Locker locker;
+ HandleScope handle_scope;
- // Create the one and only Context.
- Persistent<v8::Context> context = v8::Context::New();
- v8::Context::Scope context_scope(context);
+ // Create the one and only Context.
+ Persistent<Context> context = Context::New();
+ Context::Scope context_scope(context);
- // Use original argv, as we're just copying values out of it.
- Handle<Object> process_l = SetupProcessObject(argc, argv);
- v8_typed_array::AttachBindings(context->Global());
+ // Use original argv, as we're just copying values out of it.
+ Handle<Object> process_l = SetupProcessObject(argc, argv);
+ v8_typed_array::AttachBindings(context->Global());
- // Create all the objects, load modules, do everything.
- // so your next reading stop should be node::Load()!
- Load(process_l);
+ // Create all the objects, load modules, do everything.
+ // so your next reading stop should be node::Load()!
+ Load(process_l);
- // All our arguments are loaded. We've evaluated all of the scripts. We
- // might even have created TCP servers. Now we enter the main eventloop. If
- // there are no watchers on the loop (except for the ones that were
- // uv_unref'd) then this function exits. As long as there are active
- // watchers, it blocks.
- uv_run(uv_default_loop());
+ // All our arguments are loaded. We've evaluated all of the scripts. We
+ // might even have created TCP servers. Now we enter the main eventloop. If
+ // there are no watchers on the loop (except for the ones that were
+ // uv_unref'd) then this function exits. As long as there are active
+ // watchers, it blocks.
+ uv_run(uv_default_loop());
- EmitExit(process_l);
- RunAtExit();
+ EmitExit(process_l);
+ RunAtExit();
#ifndef NDEBUG
- // Clean up.
- context.Dispose();
+ context.Dispose();
+#endif
+ }
+
+#ifndef NDEBUG
+ // Clean up. Not strictly necessary.
V8::Dispose();
#endif // NDEBUG