Bug 816656 - Don't write the startup cache on shutdown. r=taras

The startup cache will be saved in the background ~10 seconds after startup. If 10 seconds haven't elapsed yet don't bother write the cache on shutdown.
This commit is contained in:
Benoit Girard 2012-12-03 13:10:11 -05:00
parent 98b772bfc1
commit aae082ab7f

View File

@ -139,7 +139,9 @@ StartupCache::~StartupCache()
// but an early shutdown means either mTimer didn't run
// or the write thread is still running.
WaitOnWriteThread();
WriteToDisk();
// If we shutdown quickly timer wont have fired. Instead of writing
// it on the main thread and block the shutdown we simply wont update
// the startup cache.
gStartupCache = nullptr;
(void)::NS_UnregisterMemoryReporter(mMappingMemoryReporter);
(void)::NS_UnregisterMemoryReporter(mDataMemoryReporter);