Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-109536

QNetworkAccesManager memory leak

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • 5.14.2
    • Network: HTTP
    • None
    • Ubuntu 20.04 on x86_64 CPU
    • Linux/Wayland

    Description

      Why this code, running repeatedly in a custom object moved to QThread instance, produces memory leak?

      void QCustomHTTPManager::compare()
      {
          // custom code to create request and  multiPart content
          QNetworkReply *reply = networkaccessmanager->post(request,&multiPart);
          connect(reply,&QNetworkReply::finished,eventloop,&QEventLoop::quit);
          eventloop->exec();
          emit compared();
          reply->deleteLater();
      }

      No leak when change to this:

      void QCustomHTTPManager::compare()
      {
           // custom code to create request and  multiPart content
          QTimer::singleShot(1,loop,&QEventLoop::quit);
          eventloop->exec();
          emit compared();
      }

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              manordheim Mårten Nordheim
              pi-null-mezon Alex Taranov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes