Commit ad518d95 authored by Jocelyn Turcotte's avatar Jocelyn Turcotte
Browse files

Fix a shutdown crash under CFAutoreleasePoolPop


NSAutoreleasePool init and dray must be symetrical and we can't guarantee
that for ContentMainRunner as well as Chromium can since we initialize
the ContentMainRunner on-demand but destroy it with the QCoreApplication's
destruction.

We also don't need to use it since any allocation that
ContentMainRunnerImpl::autorelease_pool_ would cover is already covered
at the bottom of the stack by the QCocoaAutoReleasePool in
QCocoaEventDispatcher::processEvents.

Change-Id: I2874916420457e3d36d08fb9fca0d919f374f592
Reviewed-by: default avatarAndras Becsi <andras.becsi@digia.com>
No related merge requests found
Showing with 4 additions and 4 deletions
......@@ -577,7 +577,7 @@ class ContentMainRunnerImpl : public ContentMainRunner {
}
#endif // !OS_ANDROID && !OS_IOS
#if defined(OS_MACOSX)
#if defined(OS_MACOSX) && !defined(TOOLKIT_QT)
// 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
......@@ -758,7 +758,7 @@ class ContentMainRunnerImpl : public ContentMainRunner {
main_params.ui_task = ui_task_;
#if defined(OS_WIN)
main_params.sandbox_info = &sandbox_info_;
#elif defined(OS_MACOSX)
#elif defined(OS_MACOSX) && !defined(TOOLKIT_QT)
main_params.autorelease_pool = autorelease_pool_.get();
#endif
......@@ -787,7 +787,7 @@ class ContentMainRunnerImpl : public ContentMainRunner {
#endif // _CRTDBG_MAP_ALLOC
#endif // OS_WIN
#if defined(OS_MACOSX)
#if defined(OS_MACOSX) && !defined(TOOLKIT_QT)
autorelease_pool_.reset(NULL);
#endif
......@@ -816,7 +816,7 @@ class ContentMainRunnerImpl : public ContentMainRunner {
scoped_ptr<base::AtExitManager> exit_manager_;
#if defined(OS_WIN)
sandbox::SandboxInterfaceInfo sandbox_info_;
#elif defined(OS_MACOSX)
#elif defined(OS_MACOSX) && !defined(TOOLKIT_QT)
scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_;
#endif
......
Supports Markdown
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