Skip to content

fix: fix memory leak in treeland toplevel handle - #1840

Open
mhduiy wants to merge 1 commit into
linuxdeepin:masterfrom
mhduiy:agent/bugfix/383693
Open

mhduiy wants to merge 1 commit into
linuxdeepin:masterfrom
mhduiy:agent/bugfix/383693

Conversation

@mhduiy

@mhduiy mhduiy commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Root Cause Analysis

In panels/dock/taskmanager/treelandwindowmonitor.cpp, ForeignToplevelManager::treeland_foreign_toplevel_manager_v3_toplevel() creates ForeignToplevelHandle via bare new without a QObject parent. It only connects the handlerIsReady signal (triggered by the Wayland done event) but does not connect handlerIsDeleted (triggered by the closed event). When a Wayland toplevel's closed event arrives before its done event — which happens with short-lived windows, popup menus, and tooltips — the handlerIsDeleted signal is emitted but has no listener, handlerIsReady never fires, and the handle object is never claimed by m_windows or deleted. It becomes a permanently orphaned object, leaking memory on every such occurrence.

Fix

Connect handlerIsDeleted at handle creation time (line 31), and add an else branch in handleForeignToplevelHandleRemoved() to call deleteLater() on handles that were closed before being added to m_windows (the closed-before-done case). Normal flow (done-before-closed) is unchanged: handlerIsDeleted is also connected inside handleForeignToplevelHandleAdded() via Qt::UniqueConnection, so no duplicate connections occur.

Change Safety Assessment

Code Safety

  • Risk Level: Low
  • The target code pattern (bare new + only handlerIsReady connected) has existed since the initial implementation (commit 5106900, 2023-11-07) and survived three protocol migrations (wayland → treeland → treeland-v3). This fix does not revert any historical fix.
  • handleForeignToplevelHandleRemoved is a private slot with no external callers; the new else branch only affects the closed-before-done edge case.

Business Impact Scope

Affects the dock task manager's Wayland toplevel handle lifecycle. Users performing routine dock operations (opening/closing apps, switching windows, using popup menus) will no longer experience unbounded memory growth in the org.deepin.ds.dock process. No behavior change for normal window open/close flow.

Verification Suggestion

Test dock memory stability across repeated app open/close cycles, especially rapid window creation and destruction (popups, tooltips). Monitor org.deepin.ds.dock RSS over an extended session and confirm it plateaus rather than growing indefinitely.


根因分析

在 panels/dock/taskmanager/treelandwindowmonitor.cpp 中,ForeignToplevelManager::treeland_foreign_toplevel_manager_v3_toplevel() 使用裸 new 创建 ForeignToplevelHandle,无 QObject parent。该函数仅连接了 handlerIsReady 信号(由 Wayland done 事件触发),未连接 handlerIsDeleted 信号(由 closed 事件触发)。当 Wayland toplevel 的 closed 事件先于 done 事件到达时(短暂窗口、弹出菜单、tooltip 等场景),handlerIsDeleted 信号被 emit 但无监听者,handlerIsReady 永不触发,handle 对象既不被 m_windows 认领也不被清理,成为永久泄漏的孤儿对象。

修复方案

在 handle 创建时即连接 handlerIsDeleted 信号(第31行),并在 handleForeignToplevelHandleRemoved() 中新增 else 分支,对不在 m_windows 中的 pending handle 调用 deleteLater()(closed-before-done 场景)。正常流程(done 先于 closed)不受影响:handleForeignToplevelHandleAdded() 中也通过 Qt::UniqueConnection 连接了 handlerIsDeleted,不会产生重复连接。

改动安全评估

代码安全评估

  • 风险等级: 低风险
  • 目标代码模式(裸 new + 仅连接 handlerIsReady)自初始实现即存在(commit 5106900, 2023-11-07),经历三次协议迁移(wayland → treeland → treeland-v3)均保留了相同的泄漏模式。本次修复不撤销任何历史修复。
  • handleForeignToplevelHandleRemoved 是 private slot,无外部调用者;新增的 else 分支仅影响 closed-before-done 边界场景。

业务影响范围

影响任务栏 Wayland toplevel handle 的生命周期管理。用户在任务栏进行常规操作(打开/关闭应用、切换窗口、使用弹出菜单等)时,org.deepin.ds.dock 进程内存不再持续增长。正常窗口打开/关闭流程无行为变化。

验证建议

测试任务栏在反复开关应用场景下的内存稳定性,特别是快速创建和销毁窗口(弹出菜单、tooltip)。长时间监控 org.deepin.ds.dock 进程 RSS,确认其趋于稳定而非持续增长。

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Connect deletion handling when a foreign toplevel handle is created and delete handles that close before they are added to the monitor.

  • panels/dock/taskmanager/treelandwindowmonitor.cpp L31, L230-232

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="panels/dock/taskmanager/desktopfileparserfactory.h" line_range="61" />
<code_context>
             desktopFileParser = QSharedPointer<T>(new T(id));
             m_desktopFileParsers.insert(id, desktopFileParser.toWeakRef());
         }
+        pruneStaleEntries();
         return desktopFileParser;
     }
</code_context>
<issue_to_address>
**Parser lookups scan entire cache**

When many parser IDs are live and callers repeatedly query or create parsers, `createById()` calls `pruneStaleEntries()` on every call, and `pruneStaleEntries()` scans the entire `QMap`, making repeated lookups linear in the cache size and adding avoidable dock latency.

Avoid scanning the full cache on cache hits, and prune stale entries only when needed.
</issue_to_address>

### Comment 2
<location path="tests/panels/dock/docktests/desktopfileparserfactorytests.cpp" line_range="1" />
<code_context>
+// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
</code_context>
<issue_to_address>
**Pruning tests provide no coverage**

When the project configures and runs its dock test suite, the dock test CMake configuration omits `desktopfileparserfactorytests.cpp`, so its tests never compile or run; moreover, `MockFactory` reimplements `createById()` and `pruneStaleEntries()` instead of testing `DesktopfileParserFactory<T>`, so adding the file to a target alone still leaves production pruning regressions undetected.

Add the test source to a dock test target and make the tests exercise `DesktopfileParserFactory<T>` rather than a copied `MockFactory` implementation.

Also at `tests/panels/dock/docktests/desktopfileparserfactorytests.cpp:14-16`, `tests/panels/dock/docktests/desktopfileparserfactorytests.cpp:39-47`, `tests/panels/dock/docktests/desktopfileparserfactorytests.cpp:72`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread panels/dock/taskmanager/appitem.cpp Outdated
Q_EMIT activeChanged();
Q_EMIT attentionChanged();
});
}, Qt::UniqueConnection);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

匿名表达式用不了这个连接类型吧,

@mhduiy
mhduiy force-pushed the agent/bugfix/383693 branch from 36b1537 to e5cd7ad Compare November 20, 2026 17:06
@deepin-ci-robot

deepin-ci-robot commented Nov 20, 2026 •

Copy link
Copy Markdown

⚠️ OBS CI 构建警告日志 (Commit: 2e8e4a8f)

提示:以下为 OBS CI 构建中 Lintian 检测到的警告信息,默认折叠,点击展开查看详情。完整日志请参阅对应构建状态链接。

deepin_develop / aarch64 (Lintian 警告: 16 条)
[ 1087s] W: dde-shell: description-synopsis-starts-with-article
[ 1087s] N: 
[ 1087s] N:   The first line of the "Description:" should omit any initial indefinite or
[ 1087s] N:   definite article: "a", "an", or "the". A good heuristic is that it should
[ 1087s] N:   be possible to substitute the package name and synopsis into this formula:
[ 1087s] N:   
[ 1087s] N:   The package name provides {a,an,the,some} synopsis.
[ 1087s] N: 
[ 1087s] N:   Please refer to The package synopsis, or short description (Section 6.2.2)
[ 1087s] N:   in the Debian Developer's Reference for details.
[ 1087s] N: 
[ 1087s] N:   Visibility: warning
[ 1087s] N:   Show-Always: no
[ 1087s] N:   Check: fields/description
[ 1087s] N: 
[ 1087s] N:
[ 1087s] W: libdde-shell: extended-description-line-too-long line 1
[ 1087s] N: 
[ 1087s] N:   One or more lines in the extended part of the "Description:" field have
[ 1087s] N:   been found to contain more than 80 characters. For the benefit of users of
[ 1087s] N:   80x25 terminals, it is recommended that the lines do not exceed 80
[ 1087s] N:   characters.
[ 1087s] N: 
[ 1087s] N:   Please refer to The single line synopsis (Section 3.4.1) in the Debian
[ 1087s] N:   Policy Manual for details.
[ 1087s] N: 
[ 1087s] N:   Visibility: warning
[ 1087s] N:   Show-Always: no
[ 1087s] N:   Check: fields/description
[ 1087s] N: 
[ 1087s] N:
[ 1087s] W: libdde-shell-dev: extended-description-line-too-long line 1
[ 1087s] N:
[ 1087s] W: dde-shell: link-to-shared-library-in-wrong-package usr/lib/aarch64-linux-gnu/libds-notification-shared.so.2.0.42 [usr/lib/aarch64-linux-gnu/libds-notification-shared.so]
[ 1087s] N: 
[ 1087s] N:   Although this package is not a "-dev" package, it installs a
[ 1087s] N:   "libsomething.so" symbolic link referencing the corresponding shared
[ 1087s] N:   library. When the link doesn't include the version number, it is used by
[ 1087s] N:   the linker when other programs are built against this shared library.
[ 1087s] N:   
[ 1087s] N:   Shared libraries are supposed to place such symbolic links in their
[ 1087s] N:   respective "-dev" packages, so it is a bug to include it with the main
[ 1087s] N:   library package.
[ 1087s] N:   
[ 1087s] N:   However, if this is a small package which includes the runtime and the
[ 1087s] N:   development libraries, this is not a bug. In the latter case, please
[ 1087s] N:   override this warning.
[ 1087s] N: 
[ 1087s] N:   Please refer to Development files (Section 8.4) in the Debian Policy
[ 1087s] N:   Manual for details.
[ 1087s] N: 
[ 1087s] N:   Visibility: warning
[ 1087s] N:   Show-Always: no
[ 1087s] N:   Check: libraries/shared/links
[ 1087s] N:   Renamed from: non-dev-pkg-with-shlib-symlink
[ 1087s] N: 
[ 1087s] N:
[ 1087s] W: dde-shell: no-manual-page [usr/bin/dde-shell]
[ 1087s] N: 
[ 1087s] N:   Each binary in /usr/bin, /usr/sbin, /bin, /sbin or /usr/games should have
[ 1087s] N:   a manual page
[ 1087s] N:   
[ 1087s] N:   Note that though the man program has the capability to check for several
[ 1087s] N:   program names in the NAMES section, each of these programs should have its
[ 1087s] N:   own manual page (a symbolic link to the appropriate manual page is
[ 1087s] N:   sufficient) because other manual page viewers such as xman or tkman don't
[ 1087s] N:   support this.
[ 1087s] N:   
[ 1087s] N:   If the name of the manual page differs from the binary by case, man may be
[ 1087s] N:   able to find it anyway; however, it is still best practice to match the
[ 1087s] N:   exact capitalization of the executable in the manual page.
[ 1087s] N:   
[ 1087s] N:   If the manual pages are provided by another package on which this package
[ 1087s] N:   depends, Lintian may not be able to determine that manual pages are
[ 1087s] N:   available. In this case, after confirming that all binaries do have manual
[ 1087s] N:   pages after this package and its dependencies are installed, please add a
[ 1087s] N:   Lintian override.
[ 1087s] N: 
[ 1087s] N:   Please refer to Manual pages (Section 12.1) in the Debian Policy Manual
[ 1087s] N:   for details.
[ 1087s] N: 
[ 1087s] N:   Visibility: warning
[ 1087s] N:   Show-Always: no
[ 1087s] N:   Check: documentation/manual
[ 1087s] N:   Renamed from: binary-without-manpage
[ 1087s] N: 
[ 1087s] N:
[ 1087s] W: dde-shell source: no-nmu-in-changelog [debian/changelog:1]
[ 1087s] N: 
[ 1087s] N:   When you NMU a package, that fact should be mentioned on the first line in
[ 1087s] N:   the changelog entry. Use the words "NMU" or "Non-maintainer upload" (case
[ 1087s] N:   insensitive).
[ 1087s] N:   
[ 1087s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[ 1087s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[ 1087s] N:   identical to the maintainer or one of the uploaders. If this is a local
[ 1087s] N:   package (not intended for Debian), you can suppress this warning by
[ 1087s] N:   putting "local" in the version number or "local package" on the first line
[ 1087s] N:   of the changelog entry.
[ 1087s] N: 
[ 1087s] N:   Please refer to Using the DELAYED/ queue (Section 5.11.3) in the Debian
[ 1087s] N:   Developer's Reference for details.
[ 1087s] N: 
[ 1087s] N:   Visibility: warning
[ 1087s] N:   Show-Always: no
[ 1087s] N:   Check: nmu
[ 1087s] N:   Renamed from: changelog-should-mention-nmu
[ 1087s] N: 
[ 1087s] N:
[ 1087s] W: dde-shell: package-name-doesnt-match-sonames libds-notification-shared2
[ 1087s] N: 
[ 1087s] N:   The package name of a library package should usually reflect the soname of
[ 1087s] N:   the included library. The package name can determined from the library
[ 1087s] N:   file name with the following code snippet:
[ 1087s] N:   
[ 1087s] N:    $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | \
[ 1087s] N:        sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
[ 1087s] N: 
[ 1087s] N:   Visibility: warning
[ 1087s] N:   Show-Always: no
[ 1087s] N:   Check: libraries/shared/soname
[ 1087s] N: 
[ 1087s] N:
[ 1087s] W: libdde-shell: package-name-doesnt-match-sonames libdde-shell1
[ 1087s] N:
[ 1087s] W: libdde-shell-dock: package-name-doesnt-match-sonames libdde-shell-dock1
[ 1087s] N:
[ 1087s] W: dde-shell source: source-nmu-has-incorrect-version-number 2.0.42+u004 [debian/changelog:1]
[ 1087s] N: 
[ 1087s] N:   A source NMU should have a Debian revision of "-x.x" (or "+nmuX" for a
[ 1087s] N:   native package). This is to prevent stealing version numbers from the
[ 1087s] N:   maintainer.
[ 1087s] N:   
[ 1087s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[ 1087s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[ 1087s] N:   identical to the maintainer or one of the uploaders. If this is a local
[ 1087s] N:   package (not intended for Debian), you can suppress this warning by
[ 1087s] N:   putting "local" in the version number or "local package" on the first line
[ 1087s] N:   of the changelog entry.
[ 1087s] N: 
[ 1087s] N:   Please refer to NMUs and debian/changelog (Section 5.11.2) in the Debian
[ 1087s] N:   Developer's Reference for details.
[ 1087s] N: 
[ 1087s] N:   Visibility: warning
[ 1087s] N:   Show-Always: no
[ 1087s] N:   Check: nmu
[ 1087s] N: 
[ 1087s] N:
[ 1087s] W: dde-shell: unknown-section DDE
[ 1087s] N: 
[ 1087s] N:   The "Section:" field in this package's control file is not one of the
[ 1087s] N:   sections in use on the ftp archive. Valid sections are currently admin,
[ 1087s] N:   comm, cli-mono, database, debug, devel, doc, editors, electronics,
[ 1087s] N:   embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio,
[ 1087s] N:   haskell, httpd, interpreters, java, javascript, kde, libdevel, libs, lisp,
[ 1087s] N:   localization, kernel, mail, math, misc, net, news, ocaml, oldlibs,
[ 1087s] N:   otherosfs, perl, php, python, ruby, rust, science, shells, sound, tex,
[ 1087s] N:   text, utils, vcs, video, web, x11, xfce, zope.
[ 1087s] N:   
[ 1087s] N:   The section name should be preceded by either "contrib/", "non-free/" or
[ 1087s] N:   "non-free-firmware/" if the package is in the according archive area.
[ 1087s] N: 
[ 1087s] N:   Please refer to Sections (Section 2.4) in the Debian Policy Manual for
[ 1087s] N:   details.
[ 1087s] N: 
[ 1087s] N:   Visibility: warning
[ 1087s] N:   Show-Always: no
[ 1087s] N:   Check: fields/section
[ 1087s] N: 
[ 1087s] N:
[ 1087s] W: dde-shell-example: unknown-section DDE
[ 1087s] N:
[ 1087s] W: libdde-shell: unknown-section DDE
[ 1087s] N:
[ 1087s] W: libdde-shell-dev: unknown-section DDE
[ 1087s] N:
[ 1087s] W: libdde-shell-dock: unknown-section DDE
[ 1087s] N:
[ 1087s] W: libdde-shell-dock-dev: unknown-section DDE
deepin_develop / x86_64 (Lintian 警告: 16 条)
[  323s] W: dde-shell: description-synopsis-starts-with-article
[  323s] N: 
[  323s] N:   The first line of the "Description:" should omit any initial indefinite or
[  323s] N:   definite article: "a", "an", or "the". A good heuristic is that it should
[  323s] N:   be possible to substitute the package name and synopsis into this formula:
[  323s] N:   
[  323s] N:   The package name provides {a,an,the,some} synopsis.
[  323s] N: 
[  323s] N:   Please refer to The package synopsis, or short description (Section 6.2.2)
[  323s] N:   in the Debian Developer's Reference for details.
[  323s] N: 
[  323s] N:   Visibility: warning
[  323s] N:   Show-Always: no
[  323s] N:   Check: fields/description
[  323s] N: 
[  323s] N:
[  323s] W: libdde-shell: extended-description-line-too-long line 1
[  323s] N: 
[  323s] N:   One or more lines in the extended part of the "Description:" field have
[  323s] N:   been found to contain more than 80 characters. For the benefit of users of
[  323s] N:   80x25 terminals, it is recommended that the lines do not exceed 80
[  323s] N:   characters.
[  323s] N: 
[  323s] N:   Please refer to The single line synopsis (Section 3.4.1) in the Debian
[  323s] N:   Policy Manual for details.
[  323s] N: 
[  323s] N:   Visibility: warning
[  323s] N:   Show-Always: no
[  323s] N:   Check: fields/description
[  323s] N: 
[  323s] N:
[  323s] W: libdde-shell-dev: extended-description-line-too-long line 1
[  323s] N:
[  323s] W: dde-shell: link-to-shared-library-in-wrong-package usr/lib/x86_64-linux-gnu/libds-notification-shared.so.2.0.42 [usr/lib/x86_64-linux-gnu/libds-notification-shared.so]
[  323s] N: 
[  323s] N:   Although this package is not a "-dev" package, it installs a
[  323s] N:   "libsomething.so" symbolic link referencing the corresponding shared
[  323s] N:   library. When the link doesn't include the version number, it is used by
[  323s] N:   the linker when other programs are built against this shared library.
[  323s] N:   
[  323s] N:   Shared libraries are supposed to place such symbolic links in their
[  323s] N:   respective "-dev" packages, so it is a bug to include it with the main
[  323s] N:   library package.
[  323s] N:   
[  323s] N:   However, if this is a small package which includes the runtime and the
[  323s] N:   development libraries, this is not a bug. In the latter case, please
[  323s] N:   override this warning.
[  323s] N: 
[  323s] N:   Please refer to Development files (Section 8.4) in the Debian Policy
[  323s] N:   Manual for details.
[  323s] N: 
[  323s] N:   Visibility: warning
[  323s] N:   Show-Always: no
[  323s] N:   Check: libraries/shared/links
[  323s] N:   Renamed from: non-dev-pkg-with-shlib-symlink
[  323s] N: 
[  323s] N:
[  323s] W: dde-shell: no-manual-page [usr/bin/dde-shell]
[  323s] N: 
[  323s] N:   Each binary in /usr/bin, /usr/sbin, /bin, /sbin or /usr/games should have
[  323s] N:   a manual page
[  323s] N:   
[  323s] N:   Note that though the man program has the capability to check for several
[  323s] N:   program names in the NAMES section, each of these programs should have its
[  323s] N:   own manual page (a symbolic link to the appropriate manual page is
[  323s] N:   sufficient) because other manual page viewers such as xman or tkman don't
[  323s] N:   support this.
[  323s] N:   
[  323s] N:   If the name of the manual page differs from the binary by case, man may be
[  323s] N:   able to find it anyway; however, it is still best practice to match the
[  323s] N:   exact capitalization of the executable in the manual page.
[  323s] N:   
[  323s] N:   If the manual pages are provided by another package on which this package
[  323s] N:   depends, Lintian may not be able to determine that manual pages are
[  323s] N:   available. In this case, after confirming that all binaries do have manual
[  323s] N:   pages after this package and its dependencies are installed, please add a
[  323s] N:   Lintian override.
[  323s] N: 
[  323s] N:   Please refer to Manual pages (Section 12.1) in the Debian Policy Manual
[  323s] N:   for details.
[  323s] N: 
[  323s] N:   Visibility: warning
[  323s] N:   Show-Always: no
[  323s] N:   Check: documentation/manual
[  323s] N:   Renamed from: binary-without-manpage
[  323s] N: 
[  323s] N:
[  323s] W: dde-shell source: no-nmu-in-changelog [debian/changelog:1]
[  323s] N: 
[  323s] N:   When you NMU a package, that fact should be mentioned on the first line in
[  323s] N:   the changelog entry. Use the words "NMU" or "Non-maintainer upload" (case
[  323s] N:   insensitive).
[  323s] N:   
[  323s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  323s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  323s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  323s] N:   package (not intended for Debian), you can suppress this warning by
[  323s] N:   putting "local" in the version number or "local package" on the first line
[  323s] N:   of the changelog entry.
[  323s] N: 
[  323s] N:   Please refer to Using the DELAYED/ queue (Section 5.11.3) in the Debian
[  323s] N:   Developer's Reference for details.
[  323s] N: 
[  323s] N:   Visibility: warning
[  323s] N:   Show-Always: no
[  323s] N:   Check: nmu
[  323s] N:   Renamed from: changelog-should-mention-nmu
[  323s] N: 
[  323s] N:
[  323s] W: dde-shell: package-name-doesnt-match-sonames libds-notification-shared2
[  323s] N: 
[  323s] N:   The package name of a library package should usually reflect the soname of
[  323s] N:   the included library. The package name can determined from the library
[  323s] N:   file name with the following code snippet:
[  323s] N:   
[  323s] N:    $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | \
[  323s] N:        sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
[  323s] N: 
[  323s] N:   Visibility: warning
[  323s] N:   Show-Always: no
[  323s] N:   Check: libraries/shared/soname
[  323s] N: 
[  323s] N:
[  323s] W: libdde-shell: package-name-doesnt-match-sonames libdde-shell1
[  323s] N:
[  323s] W: libdde-shell-dock: package-name-doesnt-match-sonames libdde-shell-dock1
[  323s] N:
[  323s] W: dde-shell source: source-nmu-has-incorrect-version-number 2.0.42+u004 [debian/changelog:1]
[  323s] N: 
[  323s] N:   A source NMU should have a Debian revision of "-x.x" (or "+nmuX" for a
[  323s] N:   native package). This is to prevent stealing version numbers from the
[  323s] N:   maintainer.
[  323s] N:   
[  323s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  323s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  323s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  323s] N:   package (not intended for Debian), you can suppress this warning by
[  323s] N:   putting "local" in the version number or "local package" on the first line
[  323s] N:   of the changelog entry.
[  323s] N: 
[  323s] N:   Please refer to NMUs and debian/changelog (Section 5.11.2) in the Debian
[  323s] N:   Developer's Reference for details.
[  323s] N: 
[  323s] N:   Visibility: warning
[  323s] N:   Show-Always: no
[  323s] N:   Check: nmu
[  323s] N: 
[  323s] N:
[  323s] W: dde-shell: unknown-section DDE
[  323s] N: 
[  323s] N:   The "Section:" field in this package's control file is not one of the
[  323s] N:   sections in use on the ftp archive. Valid sections are currently admin,
[  323s] N:   comm, cli-mono, database, debug, devel, doc, editors, electronics,
[  323s] N:   embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio,
[  323s] N:   haskell, httpd, interpreters, java, javascript, kde, libdevel, libs, lisp,
[  323s] N:   localization, kernel, mail, math, misc, net, news, ocaml, oldlibs,
[  323s] N:   otherosfs, perl, php, python, ruby, rust, science, shells, sound, tex,
[  323s] N:   text, utils, vcs, video, web, x11, xfce, zope.
[  323s] N:   
[  323s] N:   The section name should be preceded by either "contrib/", "non-free/" or
[  323s] N:   "non-free-firmware/" if the package is in the according archive area.
[  323s] N: 
[  323s] N:   Please refer to Sections (Section 2.4) in the Debian Policy Manual for
[  323s] N:   details.
[  323s] N: 
[  323s] N:   Visibility: warning
[  323s] N:   Show-Always: no
[  323s] N:   Check: fields/section
[  323s] N: 
[  323s] N:
[  323s] W: dde-shell-example: unknown-section DDE
[  323s] N:
[  323s] W: libdde-shell: unknown-section DDE
[  323s] N:
[  323s] W: libdde-shell-dev: unknown-section DDE
[  323s] N:
[  323s] W: libdde-shell-dock: unknown-section DDE
[  323s] N:
[  323s] W: libdde-shell-dock-dev: unknown-section DDE

@mhduiy
mhduiy force-pushed the agent/bugfix/383693 branch from e5cd7ad to 1f2eda3 Compare November 23, 2026 01:37
1. Root cause: ForeignToplevelHandle created via bare new without
   QObject parent in treeland_foreign_toplevel_manager_v3_toplevel(),
   only handlerIsReady connected but not handlerIsDeleted; when
   Wayland closed event arrives before done event, handle is never
   claimed or deleted, becoming orphaned and leaking memory
2. Fix: connect handlerIsDeleted signal at handle creation time, and
   add else branch in handleForeignToplevelHandleRemoved() to call
   deleteLater() for handles not yet in m_windows
3. Impact: only affects handle lifecycle for closed-before-done case;
   normal flow unchanged, no API change

fix: 修复treeland toplevel句柄内存泄漏

1. 根因:treeland_foreign_toplevel_manager_v3_toplevel()中裸new创建
   ForeignToplevelHandle仅连接handlerIsReady未连接handlerIsDeleted,
   closed事件先于done到达时handle无法认领或清理成为孤儿对象导致泄漏
2. 方案:handle创建时即连接handlerIsDeleted信号,并在
   handleForeignToplevelHandleRemoved()新增else分支对不在m_windows的
   pending handle调用deleteLater()
3. 影响:仅影响closed-before-done场景handle生命周期;正常流程不受
   影响,无接口变更

PMS: BUG-383693
@mhduiy
mhduiy force-pushed the agent/bugfix/383693 branch from 1f2eda3 to 2e8e4a8 Compare November 30, 2026 05:19
@mhduiy mhduiy changed the title fix: prune stale weak pointers in dock parser factory fix: fix memory leak in treeland toplevel handle Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants