When automatic reference-counting (ARC) is enabled on Darwin platforms
the NSAutoReleasePool class should not be used directly, which caused a
build error if qglobal.h was included after the Foundation.h in client
code.
The preferred alternative for ARC is the scoped @autoreleasepool
construct, which allows the compiler to reason about needing to
insert _objc_autoreleasePoolPush and _objc_autoreleasePoolPop
calls.
Note that ARC translation units can be combined with non-ARC translation
units, so Qt and the QMacAutoReleasePool class can still be used in
ARC client code even if Qt is not built with ARC.
Task-number: QTBUG-51332
Change-Id: I7ef1c3146aa416a9d6a1dc299ce7b17f22f889e5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>