From c2b510909dc8839ff6578086051a22e8b21462e3 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Tue, 30 Oct 2018 16:56:38 +0100 Subject: Ensure QObject context is retained to avoid crashes 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 --- src/bluetooth/qbluetoothserver_bluez.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bluetooth/qbluetoothserver_bluez.cpp') 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(); }); } -- cgit v1.2.3