Bug 1684982 Part 2: Make XRE_mainRun create then destroy a macOS autorelease pool before entering the event loop. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D100735
This commit is contained in:
Brad Werth 2021-01-05 19:41:06 +00:00
parent 9d0615f0b4
commit b5eed866ff

View File

@ -4718,6 +4718,12 @@ nsresult XREMain::XRE_mainRun() {
// it here.
nsCOMPtr<nsIAppStartup> appStartup;
{
#ifdef XP_MACOSX
// In this scope, create an autorelease pool that will leave scope with
// it just before entering our event loop.
mozilla::MacAutoreleasePool pool;
#endif
#if defined(XP_WIN)
RefPtr<mozilla::DllServices> dllServices(mozilla::DllServices::Get());
dllServices->StartUntrustedModulesProcessor();