From 778dcaa50d4cae65e2b8d4b57d05f52bf876135c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 4 Sep 2022 16:45:55 +0200 Subject: [PATCH] Use correct calling frame for QMacAutoReleasePool debug tracker Using [NSAutoreleasePool showPools] to debug auto release pools should now show the call site that allocated QMacAutoReleasePool, instead of the QMacAutoReleasePool constructor, i.e.: ################ POOL 0x7f844c80c050 0x600003644190 ^-- allocated in function: QCoreApplicationPrivate::init() 0x600003a41080 __NSArrayM 0x60000345cca0 __NSCFString 0x600003a410e0 NSPathStore2 0x600002141680 NSPathStore2 0x6000036441b0 __NSSingleObjectArrayI Change-Id: I52d22503c1d3de5a9dbae9939569d0836cc1a840 Reviewed-by: Timur Pocheptsov --- src/corelib/kernel/qcore_mac.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qcore_mac.mm b/src/corelib/kernel/qcore_mac.mm index a46bf59a34..c4abdd271e 100644 --- a/src/corelib/kernel/qcore_mac.mm +++ b/src/corelib/kernel/qcore_mac.mm @@ -255,9 +255,9 @@ QMacAutoReleasePool::QMacAutoReleasePool() #ifdef QT_DEBUG void *poolFrame = nullptr; - void *frame; - if (backtrace_from_fp(__builtin_frame_address(0), &frame, 1)) - poolFrame = frame; + void *frames[2]; + if (backtrace_from_fp(__builtin_frame_address(0), frames, 2)) + poolFrame = frames[1]; if (poolFrame) { Dl_info info;