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

QNetworkAccesManager memory leak

XMLWordPrintable

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

      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();
      }

       

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes