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

QLocalSocket memory leak

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 5.6.0
    • Network
    • None
    • WIN7, WIN10

    Description

      On Windows simple demo cause memory leak.

      client code:

      // code placeholder
      int main(int argc, char *argv[])
      {
          QByteArray byte_array = QByteArray(1024 * 1024 * 1, 3);
      
          QLocalSocket* ptr_socket = new QLocalSocket;
          ptr_socket->connectToServer("test");
      
          ptr_socket->waitForConnected();
      
          while(1)
          {
              ptr_socket->write(byte_array);
              QThread::msleep(20);
          }
      }
      

      server code:

      // code placeholder
      QLocalServer* ptr_server = new QLocalServer();
          connect(ptr_server, &QLocalServer::newConnection, this, [=]() {
              ptr_socket = ptr_server->nextPendingConnection();
              connect(ptr_socket, &QLocalSocket::readyRead, this, [=]() {
                  ptr_socket->readAll();
              });
          });
      
          ptr_server->listen("test");
      

      server is ok. but the client's memory keep increasing.

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            crowww Wang Brazen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes