From 839634ad8f32b814c2829d912bfb26b17fe03ac7 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Fri, 30 Jan 2015 15:13:46 -0800 Subject: Don't set up an autorelease pool in ContentMainRunner on iOS This causes crashes if the shutdown path is used on iOS, because on iOS there's already a higher-level autorelease pool by the time this code can be run. BUG=None Review URL: https://codereview.chromium.org/891843002 Cr-Commit-Position: refs/heads/master@{#314021} --- content/app/content_main_runner.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'content/app/content_main_runner.cc') diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc index 2bd0acd..378a509 100644 --- a/content/app/content_main_runner.cc +++ b/content/app/content_main_runner.cc @@ -578,7 +578,10 @@ class ContentMainRunnerImpl : public ContentMainRunner { } #endif // !OS_ANDROID && !OS_IOS -#if defined(OS_MACOSX) + // Don't create this loop on iOS, since the outer loop is already handled + // and a loop that's destroyed in shutdown interleaves badly with the event + // loop pool on iOS. +#if defined(OS_MACOSX) && !defined(OS_IOS) // We need this pool for all the objects created before we get to the // event loop, but we don't want to leave them hanging around until the // app quits. Each "main" needs to flush this pool right before it goes into @@ -822,7 +825,7 @@ class ContentMainRunnerImpl : public ContentMainRunner { #endif // _CRTDBG_MAP_ALLOC #endif // OS_WIN -#if defined(OS_MACOSX) +#if defined(OS_MACOSX) && !defined(OS_IOS) autorelease_pool_.reset(NULL); #endif -- cgit v1.1