Skip to content

Commit

Permalink
src: set node_is_initialized in node::Init
Browse files Browse the repository at this point in the history
This can make node_is_initialized correctly set to true for applications
that use node::Init to embed iojs.

PR-URL: #225
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
zcbenz authored and bnoordhuis committed Jan 20, 2015
1 parent 668420d commit 22e1aea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3426,6 +3426,11 @@ void Init(int* argc,
if (!use_debug_agent) {
RegisterDebugSignalHandler();
}

// We should set node_is_initialized here instead of in node::Start,
// otherwise embedders using node::Init to initialize everything will not be
// able to set it and native modules will not load for them.
node_is_initialized = true;
}


Expand Down Expand Up @@ -3634,7 +3639,6 @@ int Start(int argc, char** argv) {

int code;
V8::Initialize();
node_is_initialized = true;

// Fetch a reference to the main isolate, so we have a reference to it
// even when we need it to access it from another (debugger) thread.
Expand Down

0 comments on commit 22e1aea

Please sign in to comment.