mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 971094 - Part 1: During shutdown, tell the profiler that the main thread JSRuntime is gone even if we leak. r=BenWa, r=bholley
This commit is contained in:
parent
8f4969bd77
commit
9366d43366
@ -832,6 +832,20 @@ ShutdownXPCOM(nsIServiceManager* servMgr)
|
||||
NS_WARNING("Component Manager was never created ...");
|
||||
}
|
||||
|
||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||
// In optimized builds we don't do shutdown collections by default, so
|
||||
// uncollected (garbage) objects may keep the nsXPConnect singleton alive,
|
||||
// and its XPCJSRuntime along with it. However, we still destroy various
|
||||
// bits of state in JS_ShutDown(), so we need to make sure the profiler
|
||||
// can't access them when it shuts down. This call nulls out the
|
||||
// JS pseudo-stack's internal reference to the main thread JSRuntime,
|
||||
// duplicating the call in XPCJSRuntime::~XPCJSRuntime() in case that
|
||||
// never fired.
|
||||
if (PseudoStack *stack = mozilla_get_pseudo_stack()) {
|
||||
stack->sampleRuntime(nullptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Shut down the JS engine.
|
||||
JS_ShutDown();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user