Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Revert "Re-add top-level v8::Locker"
Browse files Browse the repository at this point in the history
The locker makes node crash in debug mode sometimes.
For example, test/simple/test-repl.js triggers it.

This reverts commit 9a6012e.

Conflicts:

	src/node.cc
  • Loading branch information
piscisaureus committed Mar 30, 2012
1 parent 7c02b5a commit 4071815
Showing 1 changed file with 24 additions and 30 deletions.
54 changes: 24 additions & 30 deletions src/node.cc
Expand Up @@ -2759,39 +2759,33 @@ int Start(int argc, char *argv[]) {
// Use copy here as to not modify the original argv:
Init(argc, argv_copy);

V8::Initialize();
Persistent<Context> context;
{
Locker locker;
HandleScope handle_scope;

// 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());

// 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());

EmitExit(process_l);
#ifndef NDEBUG
context.Dispose();
#endif
}
v8::V8::Initialize();
v8::HandleScope handle_scope;

// Create the one and only Context.
Persistent<v8::Context> context = v8::Context::New();
v8::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());

// 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());

EmitExit(process_l);

#ifndef NDEBUG
// Clean up.
context.Dispose();
V8::Dispose();
#endif // NDEBUG

Expand Down

0 comments on commit 4071815

Please sign in to comment.