From ae94ab264ba29a41beac81a61fb39c0d4f669270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 12 Feb 2019 14:04:04 +0100 Subject: Add developer documentation on how to debug missing auto-release pools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie3942210ab5bafea22d65d6f7c9a099e40ee6b73 Reviewed-by: Morten Johan Sørvig --- src/corelib/kernel/qcore_mac_objc.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm index bc23e821fd..140c60a080 100644 --- a/src/corelib/kernel/qcore_mac_objc.mm +++ b/src/corelib/kernel/qcore_mac_objc.mm @@ -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]) { -- cgit v1.2.3