Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[node] Check if v8 is alive, win support

  • Loading branch information...
commit 49772632960e96c852687533e25df2e9d32c724c 1 parent 5f0b104
@indutny authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/
15 src/
@@ -2178,11 +2178,19 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
+#if defined(__MINGW32__) || defined(_MSC_VER)
+static void OnExit() {
+ node::Stdio::Flush();
+ node::Stdio::DisableRawMode(STDIN_FILENO);
+ EmitExit(process, -1);
static void OnExit(int code, void* args) {
EmitExit(process, code);
static void SignalExit(int signal) {
@@ -2199,7 +2207,11 @@ void Load(Handle<Object> process) {
// The node.js file returns a function 'f'
+#if defined(__MINGW32__) || defined(_MSC_VER)
+ atexit(OnExit);
on_exit(OnExit, NULL);

on_exit is a linux-ism, freebsd nor sunos has it. Don't use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
TryCatch try_catch;
@@ -2489,6 +2501,9 @@ char** Init(int argc, char *argv[]) {
void EmitExit(v8::Handle<v8::Object> process, int code) {
+ if (v8::V8::IsDead()) return;
+ HandleScope scope;
// process.emit('exit')
Local<Value> emit_v = process->Get(String::New("emit"));

on_exit is a linux-ism, freebsd nor sunos has it. Don't use it.

Please sign in to comment.
Something went wrong with that request. Please try again.