Bug 857050 - Remove a value root before shutting down. r=jimb

--HG--
extra : rebase_source : 314b43c30c5d65cf7ba05d21e743b8904fe7602f
This commit is contained in:
Jeff Walden 2013-04-02 12:16:13 -07:00
parent b1d36a593b
commit 274e156b9f
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,5 @@
// Bug 857050: Remove the timeout function root before shutting down.
function timeoutfunc() {}
timeout(1, timeoutfunc);
var g = newGlobal('new-compartment');
var dbg = Debugger(g);

View File

@ -121,7 +121,7 @@ static uintptr_t gStackBase;
static double MAX_TIMEOUT_INTERVAL = 1800.0;
static double gTimeoutInterval = -1.0;
static volatile bool gTimedOut = false;
static js::Value gTimeoutFunc;
static JS::Value gTimeoutFunc;
static bool enableMethodJit = true;
static bool enableTypeInference = true;
@ -5350,6 +5350,9 @@ main(int argc, char **argv, char **envp)
printf("OOM max count: %u\n", OOM_counter);
#endif
gTimeoutFunc = NullValue();
JS_RemoveValueRootRT(rt, &gTimeoutFunc);
DestroyContext(cx, true);
KillWatchdog();