-
Notifications
You must be signed in to change notification settings - Fork 60
fix: fix wild pointer issue when screen switching #1450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
1. Changed QScreen* to QPointer<QScreen> for m_dockScreen member variable 2. This prevents dangling pointer issues when screens are removed or changed 3. QPointer automatically becomes null when the QScreen object is deleted 4. Added include for QPointer header file 5. Updated copyright year range from 2023 to 2023-2026 Influence: 1. Test dock behavior when switching between different screen configurations 2. Verify dock doesn't crash when monitors are disconnected or reconnected 3. Test multi-monitor setup with dock moving between screens 4. Verify screen-related dock properties update correctly after screen changes 5. Test system behavior during display configuration changes fix: 修复屏幕切换时的野指针问题 1. 将 m_dockScreen 成员变量从 QScreen* 改为 QPointer<QScreen> 2. 防止屏幕被移除或更改时出现悬空指针问题 3. QPointer 在 QScreen 对象被删除时会自动变为空指针 4. 添加了 QPointer 头文件包含 5. 更新了版权年份范围从 2023 到 2023-2026 Influence: 1. 测试在不同屏幕配置切换时的停靠栏行为 2. 验证断开或重新连接显示器时停靠栏不会崩溃 3. 测试多显示器设置中停靠栏在屏幕间移动的情况 4. 验证屏幕更改后停靠栏的屏幕相关属性正确更新 5. 测试显示配置更改时的系统行为
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplaces a raw QScreen* member with a QPointer in the dock panel to prevent dangling pointer crashes when screens are removed or changed, adds the corresponding include, and updates the file copyright header years. Sequence diagram for dock screen deletion with QPointersequenceDiagram
participant DockPanel
participant QScreen
participant QtObjectSystem
DockPanel->>QScreen: store pointer in m_dockScreen (QPointer<QScreen>)
QtObjectSystem-->>QScreen: delete QScreen due to screen removal
QScreen-->>QtObjectSystem: destroyed
QtObjectSystem-->>DockPanel: m_dockScreen automatically set to null
DockPanel->>DockPanel: check m_dockScreen before screen-dependent logic
DockPanel-->>DockPanel: skip or update behavior if m_dockScreen is null
Class diagram for DockPanel using QPointer for dock screenclassDiagram
class DockPanel {
QPointer~QScreen~ m_dockScreen
}
class QScreen
DockPanel --> QScreen : references
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review这段代码的修改主要是将 以下是对该 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与改进建议总结: 改进建议:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

variable
changed
deleted
Influence:
configurations
reconnected
changes
fix: 修复屏幕切换时的野指针问题
Influence:
Summary by Sourcery
Prevent dock panel crashes due to invalid screen references when displays are removed or changed.
Bug Fixes:
Enhancements:
Chores: