Add developer documentation on how to debug missing auto-release pools

Change-Id: Ie3942210ab5bafea22d65d6f7c9a099e40ee6b73
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Tor Arne Vestbø 2019-02-12 14:04:04 +01:00
parent 6b8610f4e8
commit ae94ab264b

View File

@ -129,6 +129,16 @@ QT_USE_NAMESPACE
QT_NAMESPACE_ALIAS_OBJC_CLASS(QMacAutoReleasePoolTracker);
QT_BEGIN_NAMESPACE
/*
Manages a scoped auto-release pool.
To track autoreleases without any pools in place, such as in main()
before the runloop has started, export OBJC_DEBUG_MISSING_POOLS=YES
and break in objc_autoreleaseNoPool, e.g.:
br set -n objc_autoreleaseNoPool -c "[((NSObject*)$r14) class] == [QNSWindow class]"
*/
QMacAutoReleasePool::QMacAutoReleasePool()
: pool([[NSAutoreleasePool alloc] init])
{