macOS: Add auto-release pools for Q*ApplicationPrivate::init()
So that any objects autoreleased during application initialization are released. Otherwise they will end up in the root level pool and only be released when the application exits and the application goes out of scope. Change-Id: If02d24fd70098f9b4b1b0ea3218e0a15e438b9db Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
e4cb8c881f
commit
705c716543
@ -758,6 +758,10 @@ QCoreApplication::QCoreApplication(int &argc, char **argv
|
||||
|
||||
void QCoreApplicationPrivate::init()
|
||||
{
|
||||
#if defined(Q_OS_MACOS)
|
||||
QMacAutoReleasePool pool;
|
||||
#endif
|
||||
|
||||
Q_Q(QCoreApplication);
|
||||
|
||||
initLocale();
|
||||
|
@ -1319,6 +1319,10 @@ void QGuiApplicationPrivate::eventDispatcherReady()
|
||||
|
||||
void QGuiApplicationPrivate::init()
|
||||
{
|
||||
#if defined(Q_OS_MACOS)
|
||||
QMacAutoReleasePool pool;
|
||||
#endif
|
||||
|
||||
QCoreApplicationPrivate::init();
|
||||
|
||||
QCoreApplicationPrivate::is_app_running = false; // Starting up.
|
||||
|
@ -564,6 +564,10 @@ QApplication::QApplication(int &argc, char **argv, int _internal)
|
||||
*/
|
||||
void QApplicationPrivate::init()
|
||||
{
|
||||
#if defined(Q_OS_MACOS)
|
||||
QMacAutoReleasePool pool;
|
||||
#endif
|
||||
|
||||
QGuiApplicationPrivate::init();
|
||||
|
||||
initResources();
|
||||
|
Loading…
Reference in New Issue
Block a user