summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bluetooth/qbluetoothserver_qnx.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bluetooth/qbluetoothserver_qnx.cpp b/src/bluetooth/qbluetoothserver_qnx.cpp
index d4289368..c7015683 100644
--- a/src/bluetooth/qbluetoothserver_qnx.cpp
+++ b/src/bluetooth/qbluetoothserver_qnx.cpp
@@ -155,11 +155,11 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port)
}
// listen has already been called before
- if (d->socket && d->socket->state() == QBluetoothSocket::ListeningState)
+ if (!d->socket)
+ d->socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
+ else if (d->socket->state() == QBluetoothSocket::ListeningState)
return false;
- d->socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
-
//We can not register an actual Rfcomm port, because the platform does not allow it
//but we need a way to associate a server with a service