Commit 839634ad authored by stuartmorgan's avatar stuartmorgan Committed by Commit bot

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}
parent cebaf8cb
...@@ -578,7 +578,10 @@ class ContentMainRunnerImpl : public ContentMainRunner { ...@@ -578,7 +578,10 @@ class ContentMainRunnerImpl : public ContentMainRunner {
} }
#endif // !OS_ANDROID && !OS_IOS #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 // 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 // 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 // app quits. Each "main" needs to flush this pool right before it goes into
...@@ -822,7 +825,7 @@ class ContentMainRunnerImpl : public ContentMainRunner { ...@@ -822,7 +825,7 @@ class ContentMainRunnerImpl : public ContentMainRunner {
#endif // _CRTDBG_MAP_ALLOC #endif // _CRTDBG_MAP_ALLOC
#endif // OS_WIN #endif // OS_WIN
#if defined(OS_MACOSX) #if defined(OS_MACOSX) && !defined(OS_IOS)
autorelease_pool_.reset(NULL); autorelease_pool_.reset(NULL);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment