diff options
Diffstat (limited to 'src/corelib/kernel/qcore_mac_objc.mm')
-rw-r--r-- | src/corelib/kernel/qcore_mac_objc.mm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm index a215557aed..14c0f803b9 100644 --- a/src/corelib/kernel/qcore_mac_objc.mm +++ b/src/corelib/kernel/qcore_mac_objc.mm @@ -131,5 +131,22 @@ QAppleOperatingSystemVersion qt_apple_os_version() return v; } +// ------------------------------------------------------------------------- + +QMacAutoReleasePool::QMacAutoReleasePool() + : pool([[NSAutoreleasePool alloc] init]) +{ +} + +QMacAutoReleasePool::~QMacAutoReleasePool() +{ + // Drain behaves the same as release, with the advantage that + // if we're ever used in a garbage-collected environment, the + // drain acts as a hint to the garbage collector to collect. + [pool drain]; +} + +// ------------------------------------------------------------------------- + QT_END_NAMESPACE |