summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2020-01-16 13:58:33 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2020-01-18 08:01:56 +0000
commita5e677741a9cbc8b257a58a2ffe3c5f5ee785152 (patch)
tree6052a93a99a5d81d9dba32bb8439219d9806aa4a
parentb482674e51c097fccffa1e1cc32b4843ad393894 (diff)
downloadqtlocation-a5e677741a9cbc8b257a58a2ffe3c5f5ee785152.tar.gz
QDeclarativePositionSource::socketError - use deleteLater
This is a slot directly connected to the socket's signal. This means, deleting the socket from the slot leaves the socket's code that was emitting with an invalid 'this' pointer. Fixes: QTBUG-81069 Change-Id: I5b915f8d103809b80d1af34655eaa5231bddc7a6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/positioningquick/qdeclarativepositionsource.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/positioningquick/qdeclarativepositionsource.cpp b/src/positioningquick/qdeclarativepositionsource.cpp
index 6e042d9f..d6c62147 100644
--- a/src/positioningquick/qdeclarativepositionsource.cpp
+++ b/src/positioningquick/qdeclarativepositionsource.cpp
@@ -404,8 +404,8 @@ void QDeclarativePositionSource::socketConnected()
*/
void QDeclarativePositionSource::socketError(QAbstractSocket::SocketError error)
{
- delete m_nmeaSocket;
- m_nmeaSocket = 0;
+ m_nmeaSocket->deleteLater();
+ m_nmeaSocket = nullptr;
switch (error) {
case QAbstractSocket::UnknownSocketError: