diff options
author | Timur Pocheptsov <Timur.Pocheptsov@digia.com> | 2014-10-17 12:54:09 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-10-17 12:58:53 +0200 |
commit | a515dae96c98020f52fc990f6afdc533f9e0b469 (patch) | |
tree | 4f72c0e2ab805dc8e50bac74a94edbe3e7823fc6 /src/bluetooth/qbluetoothserver_osx.mm | |
parent | 038e0e38f96246848a6b7976690376cedb48140a (diff) |
QtBluetooth - fix QBluetoothServer (OS X)
isListening on OS X should work with 'fake ports', not
real notifications, so even if all services unregister,
server is still listening.
Change-Id: I70bce4612c2fdb0bbe94e72f2f6d12feeb427fee
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothserver_osx.mm')
-rw-r--r-- | src/bluetooth/qbluetoothserver_osx.mm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothserver_osx.mm b/src/bluetooth/qbluetoothserver_osx.mm index 444a8992..894209ba 100644 --- a/src/bluetooth/qbluetoothserver_osx.mm +++ b/src/bluetooth/qbluetoothserver_osx.mm @@ -429,7 +429,11 @@ QBluetoothServiceInfo QBluetoothServer::listen(const QBluetoothUuid &uuid, const bool QBluetoothServer::isListening() const { - return d_ptr->listener; + if (d_ptr->serverType == QSInfo::UnknownProtocol) + return false; + + const QMutexLocker lock(&QBluetoothServerPrivate::channelMapMutex()); + return QBluetoothServerPrivate::registeredServer(serverPort(), d_ptr->serverType); } void QBluetoothServer::setMaxPendingConnections(int numConnections) |