diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index d3560bb62e57..12c94513cc5f 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -1092,12 +1092,6 @@ nsXREDirProvider::DoShutdown() PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); if (mProfileNotified) { -#if (defined(XP_WIN) || defined(XP_MACOSX)) && defined(MOZ_CONTENT_SANDBOX) - if (XRE_IsParentProcess()) { - Unused << DeleteDirIfExists(mContentProcessSandboxTempDir); - } -#endif - nsCOMPtr obsSvc = mozilla::services::GetObserverService(); NS_ASSERTION(obsSvc, "No observer service?"); @@ -1120,6 +1114,12 @@ nsXREDirProvider::DoShutdown() } mProfileNotified = false; } + +#if (defined(XP_WIN) || defined(XP_MACOSX)) && defined(MOZ_CONTENT_SANDBOX) + if (XRE_IsParentProcess()) { + Unused << DeleteDirIfExists(mContentProcessSandboxTempDir); + } +#endif } #ifdef XP_WIN