Fixing bug 199465. Make the DOM shutdown code flush the XUL cache to ensure that everything is unrooted before the final JS GC is run. r=dbradley@netscape.com, sr=brendan@mozilla.org
This commit is contained in:
Родитель
c39e1544cf
Коммит
0bd6c211c8
|
@ -47,6 +47,7 @@
|
|||
#include "nsIObserverService.h"
|
||||
#include "nsIJSContextStack.h"
|
||||
#include "nsIExceptionService.h"
|
||||
#include "nsIXULPrototypeCache.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#include "nsScriptNameSpaceManager.h"
|
||||
|
@ -214,6 +215,14 @@ nsDOMSOFactory::Observe(nsISupports *aSubject,
|
|||
const PRUnichar *someData)
|
||||
{
|
||||
if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
|
||||
// Flush the XUL cache since it holds JS roots, and we're about to
|
||||
// start the final GC.
|
||||
static NS_DEFINE_CID(kXULPrototypeCacheCID, NS_XULPROTOTYPECACHE_CID);
|
||||
nsCOMPtr<nsIXULPrototypeCache> cache(do_GetService(kXULPrototypeCacheCID));
|
||||
|
||||
if (cache)
|
||||
cache->Flush();
|
||||
|
||||
nsCOMPtr<nsIThreadJSContextStack> stack =
|
||||
do_GetService("@mozilla.org/js/xpc/ContextStack;1");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче