From 0b290fb91a2fd4aa994cdc25b76a7f33a58aa62a Mon Sep 17 00:00:00 2001 From: Pale Moon Date: Fri, 26 Jan 2018 15:11:51 +0100 Subject: [PATCH] Clear gStartupCacheWrapper in the dtor. --- startupcache/StartupCache.cpp | 6 ++++++ startupcache/StartupCache.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp index 700b380808..1911fbc053 100644 --- a/startupcache/StartupCache.cpp +++ b/startupcache/StartupCache.cpp @@ -725,6 +725,12 @@ StartupCacheWrapper* StartupCacheWrapper::gStartupCacheWrapper = nullptr; NS_IMPL_ISUPPORTS(StartupCacheWrapper, nsIStartupCache) +StartupCacheWrapper::~StartupCacheWrapper() +{ + MOZ_ASSERT(gStartupCacheWrapper == this); + gStartupCacheWrapper = nullptr; +} + StartupCacheWrapper* StartupCacheWrapper::GetSingleton() { if (!gStartupCacheWrapper) diff --git a/startupcache/StartupCache.h b/startupcache/StartupCache.h index 2086bc3cff..677e44a317 100644 --- a/startupcache/StartupCache.h +++ b/startupcache/StartupCache.h @@ -217,7 +217,7 @@ class StartupCacheDebugOutputStream final class StartupCacheWrapper final : public nsIStartupCache { - ~StartupCacheWrapper() {} + ~StartupCacheWrapper(); NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISTARTUPCACHE