diff options
Diffstat (limited to 'src/plugins')
24 files changed, 57 insertions, 198 deletions
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index 9530dd83d0..db02cfd19d 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -76,12 +76,11 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time - (id) init { [locker lock]; - NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QMacAutoReleasePool pool; notificationCenter = [NSNotificationCenter defaultCenter]; currentInterface = [CWInterface interfaceWithName:nil]; [notificationCenter addObserver:self selector:@selector(notificationHandler:) name:CWPowerDidChangeNotification object:nil]; [locker unlock]; - [autoreleasepool release]; return self; } @@ -151,7 +150,7 @@ void QScanThread::quit() void QScanThread::run() { - NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QMacAutoReleasePool pool; QStringList found; mutex.lock(); CWInterface *currentInterface = [CWInterface interfaceWithName: QCFString::toNSString(interfaceName)]; @@ -233,7 +232,6 @@ void QScanThread::run() } } emit networksChanged(); - [autoreleasepool release]; } QStringList QScanThread::foundNetwork(const QString &id, const QString &name, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose) @@ -273,7 +271,7 @@ void QScanThread::getUserConfigurations() { QMutexLocker locker(&mutex); - NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QMacAutoReleasePool pool; userProfiles.clear(); NSSet *wifiInterfaces = [CWInterface interfaceNames]; @@ -354,7 +352,6 @@ void QScanThread::getUserConfigurations() } } } - [autoreleasepool release]; } QString QScanThread::getSsidFromNetworkName(const QString &name) @@ -433,7 +430,7 @@ QCoreWlanEngine::~QCoreWlanEngine() void QCoreWlanEngine::initialize() { QMutexLocker locker(&mutex); - NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QMacAutoReleasePool pool; if ([[CWInterface interfaceNames] count] > 0 && !listener) { listener = [[QT_MANGLE_NAMESPACE(QNSListener) alloc] init]; @@ -445,7 +442,6 @@ void QCoreWlanEngine::initialize() storeSession = NULL; startNetworkChangeLoop(); - [autoreleasepool release]; } @@ -466,7 +462,7 @@ bool QCoreWlanEngine::hasIdentifier(const QString &id) void QCoreWlanEngine::connectToId(const QString &id) { QMutexLocker locker(&mutex); - NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QMacAutoReleasePool pool; QString interfaceString = getInterfaceFromId(id); CWInterface *wifiInterface = @@ -538,7 +534,6 @@ void QCoreWlanEngine::connectToId(const QString &id) locker.unlock(); emit connectionError(id, InterfaceLookupError); - [autoreleasepool release]; } void QCoreWlanEngine::disconnectFromId(const QString &id) @@ -551,7 +546,7 @@ void QCoreWlanEngine::disconnectFromId(const QString &id) emit connectionError(id, DisconnectionError); return; } - NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QMacAutoReleasePool pool; CWInterface *wifiInterface = [CWInterface interfaceWithName: QCFString::toNSString(interfaceString)]; @@ -560,14 +555,13 @@ void QCoreWlanEngine::disconnectFromId(const QString &id) [wifiInterface disassociate]; QTimer::singleShot(1000, this,SLOT(checkDisconnect())); - [autoreleasepool release]; } void QCoreWlanEngine::checkDisconnect() { QMutexLocker locker(&mutex); if (!disconnectedInterfaceString.isEmpty()) { - NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QMacAutoReleasePool pool; CWInterface *wifiInterface = [CWInterface interfaceWithName: QCFString::toNSString(disconnectedInterfaceString)]; @@ -579,7 +573,6 @@ void QCoreWlanEngine::checkDisconnect() emit connectionError(id, DisconnectionError); locker.relock(); } - [autoreleasepool release]; disconnectedInterfaceString.clear(); } } @@ -594,7 +587,7 @@ void QCoreWlanEngine::doRequestUpdate() { QMutexLocker locker(&mutex); - NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QMacAutoReleasePool pool; NSSet *wifiInterfaces = [CWInterface interfaceNames]; for (NSString *ifName in wifiInterfaces) { @@ -604,7 +597,6 @@ void QCoreWlanEngine::doRequestUpdate() locker.unlock(); if ([wifiInterfaces count] == 0) networksChanged(); - [autoreleasepool release]; } bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName) @@ -612,12 +604,11 @@ bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName) QMutexLocker locker(&mutex); bool haswifi = false; if(hasWifi) { - NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QMacAutoReleasePool pool; CWInterface *defaultInterface = [CWInterface interfaceWithName: QCFString::toNSString(wifiDeviceName)]; if (defaultInterface.powerOn) { haswifi = true; } - [autoreleasepool release]; } return haswifi; } @@ -811,7 +802,7 @@ quint64 QCoreWlanEngine::bytesReceived(const QString &id) quint64 QCoreWlanEngine::startTime(const QString &identifier) { QMutexLocker locker(&mutex); - NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; + QMacAutoReleasePool pool; quint64 timestamp = 0; NSString *filePath = @"/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist"; @@ -858,7 +849,6 @@ quint64 QCoreWlanEngine::startTime(const QString &identifier) } } } - [autoreleasepool release]; return timestamp; } diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro index ad6cb3a1fc..ba0e6b001a 100644 --- a/src/plugins/platforms/cocoa/cocoa.pro +++ b/src/plugins/platforms/cocoa/cocoa.pro @@ -12,7 +12,6 @@ OBJECTIVE_SOURCES += main.mm \ qcocoawindow.mm \ qnsview.mm \ qnsviewaccessibility.mm \ - qcocoaautoreleasepool.mm \ qnswindowdelegate.mm \ qcocoanativeinterface.mm \ qcocoaeventdispatcher.mm \ @@ -48,7 +47,6 @@ HEADERS += qcocoaintegration.h \ qcocoabackingstore.h \ qcocoawindow.h \ qnsview.h \ - qcocoaautoreleasepool.h \ qnswindowdelegate.h \ qcocoanativeinterface.h \ qcocoaeventdispatcher.h \ diff --git a/src/plugins/platforms/cocoa/main.mm b/src/plugins/platforms/cocoa/main.mm index eed2ad7dc5..ed139b98b2 100644 --- a/src/plugins/platforms/cocoa/main.mm +++ b/src/plugins/platforms/cocoa/main.mm @@ -52,7 +52,7 @@ QPlatformIntegration * QCocoaIntegrationPlugin::create(const QString& system, co { Q_UNUSED(paramList); - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (system.compare(QLatin1String("cocoa"), Qt::CaseInsensitive) == 0) return new QCocoaIntegration; diff --git a/src/plugins/platforms/cocoa/qcocoaautoreleasepool.h b/src/plugins/platforms/cocoa/qcocoaautoreleasepool.h deleted file mode 100644 index 8b2a9f3788..0000000000 --- a/src/plugins/platforms/cocoa/qcocoaautoreleasepool.h +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QCOCOAAUTORELEASEPOOL_H -#define QCOCOAAUTORELEASEPOOL_H - -#undef slots -#include <qglobal.h> -#include <Cocoa/Cocoa.h> - -QT_BEGIN_NAMESPACE -class QCocoaAutoReleasePool -{ -public: - QCocoaAutoReleasePool(); - ~QCocoaAutoReleasePool(); - -private: - NSAutoreleasePool *pool; -}; -QT_END_NAMESPACE - -#endif // QCOCOAAUTORELEASEPOOL_H diff --git a/src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm b/src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm deleted file mode 100644 index 8f30365186..0000000000 --- a/src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qcocoaautoreleasepool.h" - -QT_BEGIN_NAMESPACE - -QCocoaAutoReleasePool::QCocoaAutoReleasePool() -{ - pool = [[NSAutoreleasePool alloc] init]; -} - -QCocoaAutoReleasePool::~QCocoaAutoReleasePool() -{ - [pool release]; -} - -QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm index 06e957cd86..d1d6330249 100644 --- a/src/plugins/platforms/cocoa/qcocoacursor.mm +++ b/src/plugins/platforms/cocoa/qcocoacursor.mm @@ -34,7 +34,6 @@ #include "qcocoacursor.h" #include "qcocoawindow.h" #include "qcocoahelpers.h" -#include "qcocoaautoreleasepool.h" #include <QtGui/QBitmap> diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index 050fade284..1865624d57 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -66,7 +66,6 @@ ****************************************************************************/ #include "qcocoaeventdispatcher.h" -#include "qcocoaautoreleasepool.h" #include "qcocoawindow.h" #include "qcocoahelpers.h" @@ -364,7 +363,7 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags) if (d->interrupt) break; - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; NSEvent* event = 0; // First, send all previously excluded input events, if any: @@ -622,7 +621,7 @@ NSModalSession QCocoaEventDispatcherPrivate::currentModalSession() continue; if (!info.session) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(info.window->handle()); NSWindow *nswindow = cocoaWindow->nativeWindow(); if (!nswindow) @@ -670,7 +669,7 @@ void QCocoaEventDispatcherPrivate::updateChildrenWorksWhenModal() // Make the dialog children of the window // active. And make the dialog children of // the previous modal dialog unactive again: - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; int size = cocoaModalSessionStack.size(); if (size > 0){ if (QWindow *prevModal = cocoaModalSessionStack[size-1].window) @@ -691,7 +690,7 @@ void QCocoaEventDispatcherPrivate::cleanupModalSessions() // point they were marked as stopped), is that ending a session // when no other session runs below it on the stack will make cocoa // drop some events on the floor. - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; int stackSize = cocoaModalSessionStack.size(); for (int i=stackSize-1; i>=0; --i) { @@ -926,7 +925,7 @@ void QCocoaEventDispatcherPrivate::cancelWaitForMoreEvents() { // In case the event dispatcher is waiting for more // events somewhere, we post a dummy event to wake it up: - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; [NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint modifierFlags:0 timestamp:0. windowNumber:0 context:0 subtype:QtCocoaEventSubTypeWakeup data1:0 data2:0] atStart:NO]; diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 4ece1b5a22..93ee4e8624 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -53,7 +53,6 @@ #include <qvarlengtharray.h> #include <stdlib.h> #include <qabstracteventdispatcher.h> -#include "qcocoaautoreleasepool.h" #include <QDir> #include <qpa/qplatformnativeinterface.h> @@ -557,7 +556,7 @@ QCocoaFileDialogHelper::~QCocoaFileDialogHelper() { if (!mDelegate) return; - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; [mDelegate release]; mDelegate = 0; } @@ -687,7 +686,7 @@ bool QCocoaFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModalit void QCocoaFileDialogHelper::createNSOpenSavePanelDelegate() { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; const SharedPointerFileDialogOptions &opts = options(); const QList<QUrl> selectedFiles = opts->initiallySelectedFiles(); @@ -737,7 +736,7 @@ void QCocoaFileDialogHelper::exec() // QEventLoop has been interrupted, and the second-most event loop has not // yet been reactivated (regardless if [NSApp run] is still on the stack)), // showing a native modal dialog will fail. - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if ([mDelegate runApplicationModalPanel]) emit accept(); else diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index a3c72c58b9..1d8a1c5e70 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -33,7 +33,6 @@ #include "qcocoaglcontext.h" #include "qcocoawindow.h" -#include "qcocoaautoreleasepool.h" #include "qcocoahelpers.h" #include <qdebug.h> #include <QtCore/private/qcore_mac_p.h> @@ -145,7 +144,7 @@ QCocoaGLContext::QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLCo if (m_format.renderableType() != QSurfaceFormat::OpenGL) return; - QCocoaAutoReleasePool pool; // For the SG Canvas render thread + QMacAutoReleasePool pool; // For the SG Canvas render thread NSOpenGLPixelFormat *pixelFormat = static_cast <NSOpenGLPixelFormat *>(qcgl_createNSOpenGLPixelFormat(m_format)); m_shareContext = share ? static_cast<QCocoaGLContext *>(share)->nsOpenGLContext() : nil; @@ -218,7 +217,7 @@ bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface) { Q_ASSERT(surface->surface()->supportsOpenGL()); - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QWindow *window = static_cast<QCocoaWindow *>(surface)->window(); setActiveWindow(window); diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index a84c0c0f2a..c2f0c730fe 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -33,7 +33,6 @@ #include "qcocoahelpers.h" -#include "qcocoaautoreleasepool.h" #include <QtCore> #include <QtGui> @@ -630,7 +629,7 @@ QString qt_mac_applicationName() int qt_mac_mainScreenHeight() { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; // The first screen in the screens array is documented // to have the (0,0) origin. NSRect screenFrame = [[[NSScreen screens] firstObject] frame]; diff --git a/src/plugins/platforms/cocoa/qcocoainputcontext.mm b/src/plugins/platforms/cocoa/qcocoainputcontext.mm index c22fe8774b..f072991bdd 100644 --- a/src/plugins/platforms/cocoa/qcocoainputcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoainputcontext.mm @@ -34,7 +34,6 @@ #include "qnsview.h" #include "qcocoainputcontext.h" #include "qcocoanativeinterface.h" -#include "qcocoaautoreleasepool.h" #include "qcocoawindow.h" #include <QtCore/QRect> @@ -98,7 +97,7 @@ void QCocoaInputContext::reset() if (!view) return; - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (NSTextInputContext *ctxt = [NSTextInputContext currentInputContext]) { [ctxt discardMarkedText]; [view unmarkText]; diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h index ee42a83446..cc235135f1 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.h +++ b/src/plugins/platforms/cocoa/qcocoaintegration.h @@ -36,7 +36,6 @@ #include <Cocoa/Cocoa.h> -#include "qcocoaautoreleasepool.h" #include "qcocoacursor.h" #include "qcocoawindow.h" #include "qcocoanativeinterface.h" diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index c8f6dd05db..04d5769044 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -33,7 +33,6 @@ #include "qcocoaintegration.h" -#include "qcocoaautoreleasepool.h" #include "qcocoawindow.h" #include "qcocoabackingstore.h" #include "qcocoanativeinterface.h" @@ -137,7 +136,7 @@ void QCocoaScreen::updateGeometry() qreal QCocoaScreen::devicePixelRatio() const { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; NSScreen * screen = osScreen(); return qreal(screen ? [screen backingScaleFactor] : 1.0); } @@ -263,7 +262,7 @@ QCocoaIntegration::QCocoaIntegration() mInstance = this; initResources(); - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; qApp->setAttribute(Qt::AA_DontUseNativeMenuBar, false); @@ -314,7 +313,7 @@ QCocoaIntegration::~QCocoaIntegration() qt_resetNSApplicationSendEvent(); - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (!QCoreApplication::testAttribute(Qt::AA_MacPluginApplication)) { // remove the apple event handlers installed by QCocoaApplicationDelegate QCocoaApplicationDelegate *delegate = [QCocoaApplicationDelegate sharedDelegate]; diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 09a4c95469..b9ffecd3b0 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -34,7 +34,6 @@ #include "qcocoamenu.h" #include "qcocoahelpers.h" -#include "qcocoaautoreleasepool.h" #include <QtCore/QtDebug> #include <QtCore/qmetaobject.h> @@ -223,7 +222,7 @@ QCocoaMenu::QCocoaMenu() : m_menuBar(0), m_containingMenuItem(0) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; m_delegate = [[QCocoaMenuDelegate alloc] initWithMenu:this]; m_nativeItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; @@ -243,7 +242,7 @@ QCocoaMenu::~QCocoaMenu() if (m_containingMenuItem) m_containingMenuItem->clearMenu(this); - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; [m_nativeItem setSubmenu:nil]; [m_nativeMenu release]; [m_delegate release]; @@ -252,7 +251,7 @@ QCocoaMenu::~QCocoaMenu() void QCocoaMenu::setText(const QString &text) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QString stripped = qt_mac_removeAmpersandEscapes(text); [m_nativeMenu setTitle:QCFString::toNSString(stripped)]; [m_nativeItem setTitle:QCFString::toNSString(stripped)]; @@ -274,7 +273,7 @@ void QCocoaMenu::setFont(const QFont &font) void QCocoaMenu::insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QCocoaMenuItem *cocoaItem = static_cast<QCocoaMenuItem *>(menuItem); QCocoaMenuItem *beforeItem = static_cast<QCocoaMenuItem *>(before); @@ -328,7 +327,7 @@ void QCocoaMenu::insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem) void QCocoaMenu::removeMenuItem(QPlatformMenuItem *menuItem) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QCocoaMenuItem *cocoaItem = static_cast<QCocoaMenuItem *>(menuItem); if (!m_menuItems.contains(cocoaItem)) { qWarning() << Q_FUNC_INFO << "Menu does not contain the item to be removed"; @@ -358,7 +357,7 @@ QCocoaMenuItem *QCocoaMenu::itemOrNull(int index) const void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QCocoaMenuItem *cocoaItem = static_cast<QCocoaMenuItem *>(menuItem); if (!m_menuItems.contains(cocoaItem)) { qWarning() << Q_FUNC_INFO << "Item does not belong to this menu"; @@ -387,7 +386,7 @@ void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem) void QCocoaMenu::syncSeparatorsCollapsible(bool enable) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (enable) { bool previousIsSeparator = true; // setting to true kills all the separators placed at the top. NSMenuItem *previousItem = nil; @@ -445,7 +444,7 @@ void QCocoaMenu::setVisible(bool visible) void QCocoaMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QPoint pos = QPoint(targetRect.left(), targetRect.top() + targetRect.height()); QCocoaWindow *cocoaWindow = parentWindow ? static_cast<QCocoaWindow *>(parentWindow->handle()) : 0; @@ -550,7 +549,7 @@ QList<QCocoaMenuItem *> QCocoaMenu::merged() const void QCocoaMenu::syncModalState(bool modal) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (!m_enabled) modal = true; diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index 7c902a0e53..7775cdbde6 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -37,7 +37,6 @@ #include "qcocoawindow.h" #include "qcocoamenuloader.h" #include "qcocoaapplication.h" // for custom application category -#include "qcocoaautoreleasepool.h" #include "qcocoaapplicationdelegate.h" #include <QtGui/QGuiApplication> @@ -84,7 +83,7 @@ QCocoaMenuBar::~QCocoaMenuBar() void QCocoaMenuBar::insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (beforeMenu) { NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()]; @@ -127,7 +126,7 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor void QCocoaMenuBar::removeNativeMenu(QCocoaMenu *menu) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (menu->menuBar() == this) menu->setMenuBar(0); @@ -148,7 +147,7 @@ void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu) void QCocoaMenuBar::syncMenu(QPlatformMenu *menu) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QCocoaMenu *cocoaMenu = static_cast<QCocoaMenu *>(menu); Q_FOREACH (QCocoaMenuItem *item, cocoaMenu->items()) @@ -261,7 +260,7 @@ void QCocoaMenuBar::resetKnownMenuItemsToQt() void QCocoaMenuBar::updateMenuBarImmediately() { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QCocoaMenuBar *mb = findGlobalMenubar(); QCocoaWindow *cw = findWindowForMenubar(); diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index f288ab85c0..942fc8db21 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -37,7 +37,6 @@ #include "qcocoamenubar.h" #include "messages.h" #include "qcocoahelpers.h" -#include "qcocoaautoreleasepool.h" #include "qt_mac_p.h" #include "qcocoaapplication.h" // for custom application category #include "qcocoamenuloader.h" @@ -104,7 +103,7 @@ QCocoaMenuItem::QCocoaMenuItem() : QCocoaMenuItem::~QCocoaMenuItem() { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (m_menu && COCOA_MENU_ANCESTOR(m_menu) == this) SET_COCOA_MENU_ANCESTOR(m_menu, 0); @@ -139,7 +138,7 @@ void QCocoaMenuItem::setMenu(QPlatformMenu *menu) m_menu->setContainingMenuItem(0); } - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; m_menu = static_cast<QCocoaMenu *>(menu); if (m_menu) { SET_COCOA_MENU_ANCESTOR(m_menu, this); diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm index 205a49d25a..c8b54c9224 100644 --- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm +++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm @@ -234,7 +234,7 @@ void QCocoaNativeInterface::registerDraggedTypes(const QStringList &types) void QCocoaNativeInterface::setDockMenu(QPlatformMenu *platformMenu) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QCocoaMenu *cocoaPlatformMenu = static_cast<QCocoaMenu *>(platformMenu); NSMenu *menu = cocoaPlatformMenu->nsMenu(); [NSApp QT_MANGLE_NAMESPACE(qt_setDockMenu): menu]; diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm index 65cc9bc38b..93f8b2ba6f 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm @@ -33,7 +33,6 @@ #include "qcocoasystemsettings.h" -#include "qcocoaautoreleasepool.h" #include "qcocoahelpers.h" #include <QtCore/private/qcore_mac_p.h> @@ -45,7 +44,7 @@ QT_BEGIN_NAMESPACE QColor qt_mac_colorForTheme(ThemeBrush brush) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QCFType<CGColorRef> cgClr = 0; HIThemeBrushCreateCGColor(brush, &cgClr); diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 11749e14de..4b73d0af08 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -47,7 +47,6 @@ #include "qcocoamenu.h" #include "qcocoamenubar.h" #include "qcocoahelpers.h" -#include "qcocoaautoreleasepool.h" #include <QtCore/qfileinfo.h> #include <QtGui/private/qguiapplication_p.h> @@ -253,7 +252,7 @@ QPixmap QCocoaTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &siz QPlatformTheme::IconOptions iconOptions) const { Q_UNUSED(iconOptions); - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; NSImage *iconImage = [[NSWorkspace sharedWorkspace] iconForFile:QCFString::toNSString(fileInfo.canonicalFilePath())]; if (!iconImage) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index f6389a2096..8af0a71bc1 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -33,7 +33,6 @@ #include "qcocoawindow.h" #include "qcocoaintegration.h" #include "qnswindowdelegate.h" -#include "qcocoaautoreleasepool.h" #include "qcocoaeventdispatcher.h" #ifndef QT_NO_OPENGL #include "qcocoaglcontext.h" @@ -374,7 +373,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw) #ifdef QT_COCOA_ENABLE_WINDOW_DEBUG qDebug() << "QCocoaWindow::QCocoaWindow" << this; #endif - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (tlw->type() == Qt::ForeignWindow) { NSView *foreignView = (NSView *)WId(tlw->property("_q_foreignWinId").value<WId>()); @@ -410,7 +409,7 @@ QCocoaWindow::~QCocoaWindow() qDebug() << "QCocoaWindow::~QCocoaWindow" << this; #endif - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; [m_nsWindow setContentView:nil]; [m_nsWindow.helper detachFromPlatformWindow]; if (m_isNSWindowChild) { @@ -492,7 +491,7 @@ QRect QCocoaWindow::geometry() const void QCocoaWindow::setCocoaGeometry(const QRect &rect) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (m_contentViewIsEmbedded) { QPlatformWindow::setGeometry(rect); @@ -616,7 +615,7 @@ void QCocoaWindow::setVisible(bool visible) m_inSetVisible = true; - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QCocoaWindow *parentCocoaWindow = 0; if (window()->transientParent()) parentCocoaWindow = static_cast<QCocoaWindow *>(window()->transientParent()->handle()); @@ -887,7 +886,7 @@ void QCocoaWindow::setWindowState(Qt::WindowState state) void QCocoaWindow::setWindowTitle(const QString &title) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (!m_nsWindow) return; @@ -898,7 +897,7 @@ void QCocoaWindow::setWindowTitle(const QString &title) void QCocoaWindow::setWindowFilePath(const QString &filePath) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (!m_nsWindow) return; @@ -908,7 +907,7 @@ void QCocoaWindow::setWindowFilePath(const QString &filePath) void QCocoaWindow::setWindowIcon(const QIcon &icon) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; NSButton *iconButton = [m_nsWindow standardWindowButton:NSWindowDocumentIconButton]; if (iconButton == nil) { @@ -1026,7 +1025,7 @@ bool QCocoaWindow::isOpaque() const void QCocoaWindow::propagateSizeHints() { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (!m_nsWindow) return; @@ -1367,7 +1366,7 @@ bool QCocoaWindow::shouldUseNSPanel() QCocoaNSWindow * QCocoaWindow::createNSWindow() { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QRect rect = initialGeometry(window(), window()->geometry(), defaultWindowWidth, defaultWindowHeight); NSRect frame = qt_mac_flipRect(rect); diff --git a/src/plugins/platforms/cocoa/qmacclipboard.mm b/src/plugins/platforms/cocoa/qmacclipboard.mm index 3d88a8d5df..f4fd32ffd1 100644 --- a/src/plugins/platforms/cocoa/qmacclipboard.mm +++ b/src/plugins/platforms/cocoa/qmacclipboard.mm @@ -43,7 +43,6 @@ #include <stdlib.h> #include <string.h> #include "qcocoahelpers.h" -#include "qcocoaautoreleasepool.h" QT_BEGIN_NAMESPACE @@ -555,7 +554,7 @@ QMacPasteboard::sync() const QString qt_mac_get_pasteboardString(PasteboardRef paste) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; NSPasteboard *pb = nil; CFStringRef pbname; if (PasteboardCopyName(paste, &pbname) == noErr) { diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 3c12228ef6..df4ebec88b 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -39,7 +39,6 @@ #include "qnsview.h" #include "qcocoawindow.h" #include "qcocoahelpers.h" -#include "qcocoaautoreleasepool.h" #include "qmultitouch_mac_p.h" #include "qcocoadrag.h" #include <qpa/qplatformintegration.h> @@ -849,7 +848,7 @@ QT_WARNING_POP { [super updateTrackingAreas]; - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; // NSTrackingInVisibleRect keeps care of updating once the tracking is set up, so bail out early if (m_trackingArea && [[self trackingAreas] containsObject:m_trackingArea]) @@ -1786,7 +1785,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) -(void)registerDragTypes { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QStringList customTypes = qt_mac_enabledDraggedTypes(); if (currentCustomDragTypes == 0 || *currentCustomDragTypes != customTypes) { if (currentCustomDragTypes == 0) diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm index 348b537691..a2285d8a4f 100644 --- a/src/plugins/platforms/cocoa/qprintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm @@ -38,7 +38,6 @@ #include <QtCore/qcoreapplication.h> #include <QtCore/qdebug.h> -#include "qcocoaautoreleasepool.h" #ifndef QT_NO_PRINTER @@ -230,7 +229,7 @@ void QMacPrintEnginePrivate::initialize() q->gccaps = paintEngine->gccaps; - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; printInfo = [[NSPrintInfo alloc] initWithDictionary:[NSDictionary dictionary]]; QList<int> resolutions = m_printDevice->supportedResolutions(); diff --git a/src/plugins/platforms/cocoa/qt_mac_p.h b/src/plugins/platforms/cocoa/qt_mac_p.h index e210f0221f..576e0f9729 100644 --- a/src/plugins/platforms/cocoa/qt_mac_p.h +++ b/src/plugins/platforms/cocoa/qt_mac_p.h @@ -103,17 +103,6 @@ public: } }; -class Q_WIDGETS_EXPORT QMacCocoaAutoReleasePool -{ -private: - void *pool; -public: - QMacCocoaAutoReleasePool(); - ~QMacCocoaAutoReleasePool(); - - inline void *handle() const { return pool; } -}; - QString qt_mac_removeMnemonics(const QString &original); //implemented in qmacstyle_mac.cpp class Q_WIDGETS_EXPORT QMacWindowChangeEvent |