diff options
author | Juha Vuolle <juha.vuolle@insta.fi> | 2022-01-19 15:07:25 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-24 06:39:38 +0000 |
commit | f43bb5860f860331e6b732036ef231e600fe81aa (patch) | |
tree | a99a9ec1128a3f4dc95515b45bd0a4423b340480 | |
parent | 3db3ceae50be5680afebec32a9e56ecaa263ee5f (diff) | |
download | qtconnectivity-f43bb5860f860331e6b732036ef231e600fe81aa.tar.gz |
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.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/bluetooth/pingpong/pingpong.cpp b/examples/bluetooth/pingpong/pingpong.cpp index d80df3d6..f21a57ac 100644 --- a/examples/bluetooth/pingpong/pingpong.cpp +++ b/examples/bluetooth/pingpong/pingpong.cpp @@ -249,7 +249,7 @@ void PingPong::startServer() 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 |