diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-05-09 16:17:34 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-05-15 13:51:00 +0000 |
commit | e95f03f989b73bddb52a54fed6a89428de151b09 (patch) | |
tree | a04f5ae786ad7d2c80428fcd8863359639386787 /tests/auto/corelib/tools | |
parent | f4b338833e0222db68f37914ecfa21ff11fd718a (diff) |
Darwin: Remove QMacAutoReleasePool heap allocation detection
This is handled by the Objective-C runtime nowadays, where it will
abort if the situation is detected, with the option to break on
objc_autoreleasePoolInvalid to debug the situation.
Pick-to: 6.5
Change-Id: Idf2c4aacc77e41a3deebf270303f4f13cfb0819b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qmacautoreleasepool/tst_qmacautoreleasepool.mm | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/tests/auto/corelib/tools/qmacautoreleasepool/tst_qmacautoreleasepool.mm b/tests/auto/corelib/tools/qmacautoreleasepool/tst_qmacautoreleasepool.mm index e18d848f87..56631d1b01 100644 --- a/tests/auto/corelib/tools/qmacautoreleasepool/tst_qmacautoreleasepool.mm +++ b/tests/auto/corelib/tools/qmacautoreleasepool/tst_qmacautoreleasepool.mm @@ -14,7 +14,6 @@ private slots: void noPool(); void rootLevelPool(); void stackAllocatedPool(); - void heapAllocatedPool(); }; static id lastDeallocedObject = nil; @@ -63,26 +62,6 @@ void tst_QMacAutoreleasePool::stackAllocatedPool() [pool drain]; } -void tst_QMacAutoreleasePool::heapAllocatedPool() -{ - // The special case, a pool allocated on the heap, or as a member of a - // heap allocated object. This is not a supported use of QMacAutoReleasePool, - // and will result in warnings if the pool is prematurely drained. - - NSObject *allocedObject = nil; - { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - QMacAutoReleasePool *qtPool = nullptr; - { - qtPool = new QMacAutoReleasePool; - allocedObject = [[[DeallocTracker alloc] init] autorelease]; - } - [pool drain]; - delete qtPool; - } - QCOMPARE(lastDeallocedObject, allocedObject); -} - QTEST_APPLESS_MAIN(tst_QMacAutoreleasePool) #include "tst_qmacautoreleasepool.moc" |