summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2022-01-19 15:07:25 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-21 14:47:54 +0000
commit205a46c9c07f801ba20616ac00338ae5c10013a7 (patch)
treefe7ff70782c18f6bd58b015d57fa0b182e030784
parent426115b95a3e05cf3e6d40287623957fec9a6547 (diff)
Store the serviceinfo in pingpong example
The service info returned by the QBluetoothServer::listen() overload that returns it needs to be stored or otherwise it will be destroyed. The consequence was that the SDP "advertisement" didn't properly include the added pingpong service record on Windows. Task-number: QTBUG-100042 Change-Id: I79cbd0f574e35bbc1c9c3123ce8382f3aad296d4 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit debf0fd212b232bcd83c8bb8f51ba2bad2f57a1c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--examples/bluetooth/pingpong/pingpong.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/bluetooth/pingpong/pingpong.cpp b/examples/bluetooth/pingpong/pingpong.cpp
index b6e6196c..9a446542 100644
--- a/examples/bluetooth/pingpong/pingpong.cpp
+++ b/examples/bluetooth/pingpong/pingpong.cpp
@@ -270,7 +270,7 @@ void PingPong::startServer()
connect(m_serverInfo, &QBluetoothServer::errorOccurred, this, &PingPong::serverError);
const QBluetoothUuid uuid(serviceUuid);
- m_serverInfo->listen(uuid, QStringLiteral("PingPong server"));
+ m_serviceInfo = m_serverInfo->listen(uuid, QStringLiteral("PingPong server"));
//! [Starting the server]
setMessage(QStringLiteral("Server started, waiting for the client. You are the left player."));
// m_role is set to 1 if it is a server