From ddbbafab6360509651a7daa341c3756e99eb32da Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Wed, 18 Sep 2013 18:35:08 +0200 Subject: [PATCH] Fixed crash QIODevice was deleted when DownloadJob was autodeleted, causing dangling pointers. --- kded/backends/lan/downloadjob.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kded/backends/lan/downloadjob.cpp b/kded/backends/lan/downloadjob.cpp index 34517962d..cc04697b4 100644 --- a/kded/backends/lan/downloadjob.cpp +++ b/kded/backends/lan/downloadjob.cpp @@ -23,12 +23,13 @@ DownloadJob::DownloadJob(QHostAddress address, QVariantMap transferInfo): KJob() { mPort = transferInfo["port"].toInt(); - mSocket = new QTcpSocket(this); + mSocket = new QTcpSocket(); mAddress = address; } void DownloadJob::start() { + qDebug() << "start"; mSocket->connectToHost(mAddress, mPort, QIODevice::ReadOnly); connect(mSocket, SIGNAL(disconnected()), this, SLOT(disconnected())); } @@ -40,5 +41,6 @@ void DownloadJob::disconnected() QIODevice* DownloadJob::getPayload() { + qDebug() << "getPayload"; return mSocket; }