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

device utilities have a memory leak in Wifi handling

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/Yocto
    • Commits:
      b80655d9ec266155e3719d91c17ed69e81a3a103 (qt/qtdeviceutilities/dev) 70bff8fd1eaa340eca40bbc4ffd9bdf1f593603f (qt/qtdeviceutilities/6.2) 5dfaab214d29133bbb2f7e23726f2ef8cd8e8e08 (qt/qtdeviceutilities/5.15)
    • Sprint:
      2021wk36POeLinuxRTOS, 2021wk38POeLinuxRTOS, 2021wk40POeLinuxRTOS, 2021wk42POEmbedded, 2021wk44POEmbedded, 2021wk46POEmbedded, 2021wk48POEmbedded

      Description

      If the WIFI network changes often it leads to a memory leak, because the network service is not deleted on change:

      void QNetworkSettingsManagerPrivate::handleNewService(const QString &servicePath)

      creates the service:

      QNetworkSettingsService *service = new QNetworkSettingsService(servicePath, this);

      and expects it to be only deleted when QNetworkSettingsManager is destroyed.

      Possible workaround can be:

      bool QNetworkSettingsServiceModel::removeService(const QString &id)
      {
          bool ret = false;
          for (int i=0; i < m_items.count(); i++) {
             if (m_items.at(i)->id() == id) {
                 // workaround
                 m_items[i]->deleteLater();
                 // workaround end
                 remove(i);
                 ret = true;
                 break;
             }
          }
          return ret;
      }
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              jannej Janne Juntunen
              Reporter:
              karimpinter Karim Pinter (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes