Commit ddbbafab authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Fixed crash

QIODevice was deleted when DownloadJob was autodeleted, causing dangling
pointers.
parent f8825e01
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment