pick from master - #393
Merged
deepin-bot[bot] merged 3 commits intoSep 18, 2026
Merged
pick from master#393
Conversation
Render task structs now carry a renderer shared reference and a uuid snapshot; workers dereference only those and skip tasks whose sheet is gone (existSheetByUuid). DocSheet owns SheetRenderer via QSharedPointer and purges queued tasks (clearAllTasksForSheet/Page) before destruction. BrowserPage validates page aliveness before writing render results back, and the pinch-zoom timer callback is bound to its receiver to avoid UAF. 渲染任务结构体改为携带渲染器共享引用与入队时快照的 uuid:worker 线 程仅解引用这两者,并经 existSheetByUuid 跳过已销毁文档的任务。 DocSheet 改用 QSharedPointer 持有 SheetRenderer,析构前排空排队任务 (clearAllTasksForSheet/Page);BrowserPage 回写渲染结果前校验页面 存活;捏合缩放定时器回调绑定 receiver,消除悬空指针。 Log: 渲染任务生命周期加固,消除文档销毁后 worker/回包路径悬空指针 PMS: BUG-377151 Influence: 文档关闭/缩放过程中渲染回调不再有悬空指针风险;正常渲染行为不变。
…han states Cleanup could leave dangling references because bookmarks and tab groups were removed independently while ownership records were still being reconciled; the residue was re-persisted by later sync runs. 孤立状态下的书签与标签组独立清理时归属记录仍在协调,残留项会被 后续同步再次落盘。 Log: 修复孤立状态下书签与标签组清理不同步导致残留引用的问题 Influence: 数据库书签与标签组清理逻辑,孤立状态下不再残留悬挂引用。
Sidebar thumbnails followed eye-protection mode and stayed white in dark theme. Now they follow the system theme only: white pages are inverted via the shared NightFilter (CIELAB L*), image objects keep original colors through a mask prefetched by the worker and cached with the thumbnail, and scanned pages (>70% coverage) are fully inverted. Bookmark/notes lists and the search-result page thumbnails follow the same rules, and mask rects are scaled to the scaled pixmap before filtering. 侧边栏缩略图原先跟随护眼模式,深色主题下仍是白底。现改为只跟随系统 深浅主题:白底经主干夜间滤镜(CIELAB L*)反转为黑底白字,照片区域按 worker 预取、随缩略图缓存的图片对象蒙版保持原色,扫描页(覆盖率超 70%)整页反色;书签/注释列表与搜索结果页的页面小图同规则,蒙版坐标 先映射到缩放后的像素图再进滤镜。 Log: 侧边栏缩略图/书签/注释/搜索结果深色主题反色并支持图片对象蒙版 PMS: BUG-377151 Influence: 深色主题下侧边栏(含触发搜索后的结果页)观感与主视图一致,浅色主题显示不变。
Reviewer's GuideThe PR hardens asynchronous document rendering against sheet/page lifetime races by passing immutable task snapshots and shared renderer ownership, adds thumbnail image-region metadata for consistent NightFilter-based dark-mode rendering across sidebar views, cleans tab-group orphans, and updates comprehensive unit tests and stubs. Sequence diagram for lifetime-safe asynchronous page renderingsequenceDiagram
participant BrowserPage
participant PageRenderThread
participant SheetRenderer
participant MainThread
BrowserPage->>PageRenderThread: appendTask(renderer, uuid, pageIndex)
PageRenderThread->>SheetRenderer: getImage(pageIndex, ...)
SheetRenderer-->>PageRenderThread: rendered image
PageRenderThread-->>MainThread: sigDocPageNormalImageTaskFinished(task, pixmap)
MainThread->>BrowserPage: existPage(task.page)
alt page is alive
MainThread->>BrowserPage: handleRenderFinished(pixmapId, pixmap)
else page was destroyed
MainThread-->>PageRenderThread: discard stale callback
end
Sequence diagram for dark-mode thumbnail metadata flowsequenceDiagram
participant SideBarImageViewModel
participant PageRenderThread
participant SheetRenderer
participant DocSheet
participant ThumbnailDelegate
participant NightFilter
SideBarImageViewModel->>PageRenderThread: appendTask(renderer, uuid, index)
PageRenderThread->>SheetRenderer: getImage(index, 174, 174)
PageRenderThread->>SheetRenderer: getImageObjectRects(index, 174, 174)
PageRenderThread-->>SideBarImageViewModel: handleRenderThumbnail(index, pixmap, imageRects)
SideBarImageViewModel->>DocSheet: setThumbnail(index, pixmap, imageRects)
ThumbnailDelegate->>DocSheet: data(IMAGE_NIGHT_MASK)
ThumbnailDelegate->>NightFilter: applyPage(pixmap, imageRects)
NightFilter-->>ThumbnailDelegate: dark-mode pixmap
Entity relationship diagram for document orphan cleanuperDiagram
DOCUMENT ||--o{ BOOKMARK : contains
DOCUMENT ||--o{ TABGROUP : contains
DOCUMENT {
string filePath
}
BOOKMARK {
string filePath
}
TABGROUP {
string filePath
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
lzwind
approved these changes
Sep 18, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
deepin-bot
Bot
merged commit Sep 18, 2026
a9df07b
into
linuxdeepin:release/snipe
8 of 9 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pick from master
Summary by Sourcery
Harden asynchronous document rendering against object-lifetime races and unify dark-theme thumbnail rendering across sidebar views.
New Features:
Bug Fixes:
Enhancements:
Tests: