How to ensure an object is deleted via deleteLater() before the event loop ended?
In a thread:
How to ensure
someObjectis deleted before the event loop ended?
doesn't make sende to use deleteLater() then.
In such case you can use delete actually.
You could force the events to be processed by the QApplication instance, but this raises the chance for side-effects and should by all means be avoided.
deletedirectly is ok, however
deletein a event driven way also makes sense, I did it this way:
connect(networkReply, &QNetworkReply::destroyed, this, &QThread::quit);
deletedirectly is more efficient and not too complex, but the event driven ways is more general.