diff options
Diffstat (limited to 'src/plugins/bearer/corewlan/qcorewlanengine.mm')
-rw-r--r-- | src/plugins/bearer/corewlan/qcorewlanengine.mm | 30 |
1 files changed, 10 insertions, 20 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; } |