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

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.1.3, 6.2.0 Beta1, 6.3.0 Alpha
    • 5.15.2, 6.1.1
    • QPA: X11/XCB
    • None
    • openSUSE Tumbleweed with XFCE
    • Linux/X11
    • 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

            srutledg Shawn Rutledge
            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