Add handlescope and flush to process.reallyExit()
authorRyan Dahl <ry@tinyclouds.org>
Mon, 8 Feb 2010 05:59:56 +0000 (21:59 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Mon, 8 Feb 2010 05:59:56 +0000 (21:59 -0800)
src/node.cc

index 5726578..493fad1 100644 (file)
@@ -465,11 +465,10 @@ static Handle<Value> Umask(const Arguments& args){
 }
 
 v8::Handle<v8::Value> Exit(const v8::Arguments& args) {
-  int r = 0;
-  if (args.Length() > 0)
-    r = args[0]->IntegerValue();
+  HandleScope scope;
   fflush(stderr);
-  exit(r);
+  Stdio::Flush();
+  exit(args[0]->IntegerValue());
   return Undefined();
 }