CocoaPlugin: remove autoreleasepool warnings on 10.6
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>
Tue, 4 Sep 2012 12:15:20 +0000 (14:15 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 10 Sep 2012 12:09:45 +0000 (14:09 +0200)
All examples running on 10.6 complained about missing autoreleasepools. This
patch adds them in where they were missing.

Change-Id: I18a1ddf486efdd1ece82d82d111b46e2ef064ff1
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
src/plugins/platforms/cocoa/qcocoaintegration.mm
src/plugins/platforms/cocoa/qcocoawindow.mm

index 65ee03d..dfb1151 100644 (file)
@@ -209,6 +209,7 @@ QCocoaIntegration::QCocoaIntegration()
 
 QCocoaIntegration::~QCocoaIntegration()
 {
+    QCocoaAutoReleasePool pool;
     if (!QCoreApplication::testAttribute(Qt::AA_MacPluginApplication)) {
         // remove the apple event handlers installed by QCocoaApplicationDelegate
         QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) *delegate = [QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) sharedDelegate];
index d2c1d37..ae9fd6e 100644 (file)
@@ -211,6 +211,7 @@ QCocoaWindow::~QCocoaWindow()
     qDebug() << "QCocoaWindow::~QCocoaWindow" << this;
 #endif
 
+    QCocoaAutoReleasePool pool;
     clearNSWindow(m_nsWindow);
     [m_contentView release];
     [m_nsWindow release];
@@ -229,6 +230,7 @@ void QCocoaWindow::setGeometry(const QRect &rect)
 
 void QCocoaWindow::setCocoaGeometry(const QRect &rect)
 {
+    QCocoaAutoReleasePool pool;
     if (m_nsWindow) {
         NSRect bounds = qt_mac_flipRect(rect, window());
         [m_nsWindow setContentSize : bounds.size];