Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.2, 6.1.1
-
None
-
openSUSE Tumbleweed with XFCE
-
-
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()