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

QSystemTrayIcon::isSystemTrayAvailable() opens a new file descriptor on each call which isn't closed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.15.2, 6.1.1
    • Fix Version/s: 6.1.3, 6.2.0 Beta1, 6.3.0 Alpha
    • Component/s: QPA: X11/XCB
    • Labels:
      None
    • Environment:
      openSUSE Tumbleweed with XFCE
    • Platform/s:
      Linux/X11
    • Commits:
      2ca19d2dd3137f2c29dcb2b1f2d23b23f3f1b0aa (qt/qtbase/dev) 52f93a88eb775e699dea38f9b58b4dd0b71dd723 (qt/qtbase/6.1) 25faf33ebd08cdd4e3a9066f6284ecbc3c6e27d6 (qt/qtbase/6.2)

      Description

      Calling QSystemTrayIcon::isSystemTrayAvailable() generates a new connection in QDBusTrayIcon::isSystemTrayAvailable() with a new unique instance ID. These are never closed, so calling QSystemTrayIcon::isSystemTrayAvailable() frequently leads to a crash when it runs out of file descriptors.

      I opened a proposal for a fix here: https://codereview.qt-project.org/c/qt/qtbase/+/354631

      It might also be preferred to have a non-static function too that can be called when a QSystemTrayIcon is already created, instead of calling the static function which will create a new QDBusTrayIcon on each call. Since a system tray icon can appear / disappear while the program is running. I can create a proposal to add this if you want, but it needs to have a different name, it could be called just: QSystemTrayIcon::isAvailable()

       

        Attachments

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

          Activity

            People

            Assignee:
            srutledg Shawn Rutledge
            Reporter:
            jonaski Jonas Kvinge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There is 1 open Gerrit change