Warning when cancel download file?
-
Hi,
Are you doing any
delete
call in your code ?By the way, which version of Qt are you using ?
On what platform ? -
From the snippet you posted, you don't use
delete
butdeleteLater
. Why are you calling disconnect ? It will kill all connections done to the object. -
Because the event loop has not yet processed every event thus the download might go some bytes further defore everything is processed.
-
@Kien-Bui for me, I called
deleteLater
2 times while I set them_reply
as null after the first time, so the second time Qt warned meQCoreApplication::postEvent: Unexpected null receiver
correctly.
That behavior was because I forgot that callingabort
results in emitting thefinished
signal.
Just for testing, wrap thedeleteLater
with a null checking if statement.if (this->reply != nullptr) { this->reply->deleteLater();
Also, you can use the
delete
with care if you like.