static NS_DEFINE_CID(kXULPrototypeCacheCID, NS_XULPROTOTYPECACHE_CID); nsCOMPtr<nsIXULPrototypeCache> cache(do_GetService(kXULPrototypeCacheCID));  if (cache) cache->Flush();
nsDOMSOFactory::Observe(nsISupports *aSubject,                         const char *aTopic,                        const PRUnichar *someData){  if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {    nsCOMPtr<nsIThreadJSContextStack> stack =      do_GetService("@mozilla.org/js/xpc/ContextStack;1");    if (stack) {      JSContext *cx = nsnull;      stack->GetSafeJSContext(&cx);      if (cx) {        // Do one final GC to clean things up before shutdown.        ::JS_GC(cx);      }    }    GlobalWindowImpl::ShutDown();    nsDOMClassInfo::ShutDown();    nsJSEnvironment::ShutDown();    nsCOMPtr<nsIExceptionService> xs =      do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID);    if (xs) {      xs->UnregisterExceptionProvider(this, NS_ERROR_MODULE_DOM);    }  }  return NS_OK;}