summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothserver_bluez.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2018-10-30 16:56:38 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2018-10-31 08:19:38 +0000
commitc2b510909dc8839ff6578086051a22e8b21462e3 (patch)
tree6e9d89fc5139826a28f1f10b03919ffd758a949b /src/bluetooth/qbluetoothserver_bluez.cpp
parent8d279a05f2570ae1b964c90efd9a5bf2ce154b76 (diff)
Ensure QObject context is retained to avoid crashesv5.12.0-beta4
If the public class is deleted pending lambda invocation can cause crashes unless QObject context is provided. This fixes a regression introduced by 819bb06c2cb3372cb1bb9ddd7f3a504f78d3452d. This was discovered while investigating QTBUG-71479. Change-Id: I3a49916ce6d9425c684863bb0b04a10bd3e652b9 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothserver_bluez.cpp')
-rw-r--r--src/bluetooth/qbluetoothserver_bluez.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothserver_bluez.cpp b/src/bluetooth/qbluetoothserver_bluez.cpp
index f45aee28..54bc85a0 100644
--- a/src/bluetooth/qbluetoothserver_bluez.cpp
+++ b/src/bluetooth/qbluetoothserver_bluez.cpp
@@ -253,7 +253,7 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port)
d->socketNotifier = new QSocketNotifier(d->socket->socketDescriptor(),
QSocketNotifier::Read);
connect(d->socketNotifier, &QSocketNotifier::activated,
- [d](){
+ this, [d](){
d->_q_newConnection();
});
}