Bug 1033442 - Fix two innocuous live-at-exit strings in the shell; r=luke

--HG--
extra : rebase_source : 7dbdf0d43e97450d3045217c0787317257e0a288
This commit is contained in:
Terrence Cole 2014-08-21 14:14:41 -07:00
parent cc6301d1b2
commit bf352a476f

View File

@ -5925,6 +5925,8 @@ SetRuntimeOptions(JSRuntime *rt, const OptionParser &op)
if (jsCacheDir) {
if (!op.getBoolOption("no-js-cache-per-process"))
jsCacheDir = JS_smprintf("%s/%u", jsCacheDir, (unsigned)getpid());
else
jsCacheDir = JS_strdup(rt, jsCacheDir);
jsCacheAsmJSPath = JS_smprintf("%s/asmjs.cache", jsCacheDir);
}
@ -5966,10 +5968,14 @@ Shell(JSContext *cx, OptionParser *op, char **envp)
JS_DumpCompartmentPCCounts(cx);
if (!op->getBoolOption("no-js-cache-per-process")) {
if (jsCacheAsmJSPath)
if (jsCacheAsmJSPath) {
unlink(jsCacheAsmJSPath);
if (jsCacheDir)
JS_free(cx, const_cast<char *>(jsCacheAsmJSPath));
}
if (jsCacheDir) {
rmdir(jsCacheDir);
JS_free(cx, const_cast<char *>(jsCacheDir));
}
}
return result;