Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QNetworkReply deleteLater before finished



  • Hi All,

    I know that i should use deleteLater(), but can I use it before finished? For example:
    @
    void do_request()
    {
    QNetworkRequest request;
    request.setUrl(QUrl(ntf_url.c_str()));

    QNetworkReply *reply = nam->get(request);
    if (reply)
    {
        reply->deleteLater();
    }
    

    }
    @



  • Hi,
    deleteLater will make sure the object is removed when it's event list is empty. Can't you connect the finished signal to the deleteLater slot??


Log in to reply