Bug 191675 JS Shell (1.3.1+) Quit() calls exit() without cleaning up.

r=rogerl


git-svn-id: svn://10.0.0.236/trunk@137519 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
timeless%mozdev.org
2003-02-07 03:51:59 +00:00
parent 1e9033b05f
commit d5ed20b8df

View File

@@ -90,9 +90,9 @@
#define EXITCODE_RUNTIME_ERROR 3
#define EXITCODE_FILE_NOT_FOUND 4
size_t gStackChunkSize = 8192;
int gExitCode = 0;
JSBool gQuitting = JS_FALSE;
FILE *gErrFile = NULL;
FILE *gOutFile = NULL;
@@ -376,7 +376,7 @@ Process(JSContext *cx, JSObject *obj, char *filename)
}
JS_DestroyScript(cx, script);
}
} while (!hitEOF);
} while (!hitEOF && !gQuitting);
fprintf(gOutFile, "\n");
return;
}
@@ -648,15 +648,13 @@ Help(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
static JSBool
Quit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
int r = 0;
#ifdef LIVECONNECT
JSJ_SimpleShutdown();
#endif
JS_ConvertArguments(cx, argc, argv,"/ i", &r);
JS_ConvertArguments(cx, argc, argv,"/ i", &gExitCode);
exit(r);
gQuitting = JS_TRUE;
return JS_FALSE;
}