You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: eliminate remaining memory leaks in application-tray
SNI icon handling:
- Add m_cachedAttentionIcon / m_cachedOverlayIcon to cache attention
and overlay icons, following the same pattern as m_cachedIcon, to
avoid repeated D-Bus pixmap reads during attention state blinking
- Skip icon pixmap updates on NewIcon / NewOverlayIcon /
NewAttentionIcon signals when the client provides a theme icon name,
since the getter already resolves icons from the icon theme in that
case and the cached pixmap is not needed
- Rework dbusImageList2QIcon: deep-copy the DBusImageList before
modifying pixel data to fix const-cast undefined behavior with Qt6
QByteArray; use quint32* for correct type semantics and bounded
iteration (size/4 instead of raw byte stride)
XCB image lifecycle (XEmbed path):
- Fix xcb_image_t leak in Util::convertFromNative when the pixel depth
falls into the unsupported default case
- Explicitly call xcb_image_destroy when QImage construction from
xcb_image_t fails, since Qt's cleanup callback is not invoked in the
null state
- Replace QSharedPointer/QScopedPointer default delete deleters with
explicit free() for xcb reply pointers allocated via malloc, fixing
undefined behavior and potential leaks in both Util and
XembedProtocolHandler
- Refactor getX11WindowImageNonComposite to deep-copy the image data
via QImage::copy and immediately destroy the xcb_image_t, bypassing
Qt's unreliable cleanup callback that can be evaded by std::move and
heuristic mask operations
Build:
- Fix debian/rules to export QT_SELECT=qt6 instead of qt5 since
the tray plugin links against Qt6
Together with the corresponding DTK fix (QMetaType::destruct before
construct in DDBusExtendedAbstractInterface::internalPropGet), this
reduces application-tray RSS growth from ~23 KB/s to negligible levels.
SNI 图标处理:
- 新增 m_cachedAttentionIcon / m_cachedOverlayIcon 缓存 attention/overlay
图标,沿用 m_cachedIcon 的缓存模式,避免闪烁状态期间每次 paint
重复走 DBus 属性读取
- NewIcon / NewOverlayIcon / NewAttentionIcon 信号处理中,当客户端提供
主题图标名时跳过 pixmap 更新,因为 getter 已经优先从图标主题加载
- 重写 dbusImageList2QIcon: 修改像素数据前显式深拷贝 DBusImageList,
修正 Qt6 QByteArray 的 const_cast 未定义行为;使用 quint32* 替代
qint32* 获得正确的类型语义,循环边界改为 size/4
XCB 图像生命周期:
- convertFromNative 函数 default 分支中释放 xcb_image_t 防止泄漏
- QImage 从 xcb_image_t 构造失败时显式调用 xcb_image_destroy,弥补
Qt 在 null state 下不触发 cleanup callback 的问题
- QSharedPointer/QScopedPointer 使用 free 替代默认的 delete 释放
malloc 分配的 xcb reply 指针,修正未定义行为
- getX11WindowImageNonComposite 通过 QImage::copy 深拷贝后直接
xcb_image_destroy,绕过 Qt cleanup callback 被 std::move 和
heuristic mask 绕过的风险
构建:
- debian/rules 修正 QT_SELECT=qt6,匹配实际 Qt6 链接
配合 DTK 修复(DDBusExtendedAbstractInterface::internalPropGet 中
construct 前添加 destruct),application-tray RSS 增长从约 23 KB/s
降至可忽略水平。
Log: fix: eliminate remaining memory leaks in application-tray
Pms: BUG-359161
0 commit comments