Merged
Conversation
Contributor
There was a problem hiding this comment.
Hey - 我给出了一些高层次的反馈:
- 现在
connected_已经成为connected()的唯一“真实来源”,请再次检查所有创建/销毁 Wayland 连接的代码路径(例如析构函数、open中的错误路径、bind_protocol/prepare_device失败的情况),确保connected_始终与实际连接状态保持同步,并且在display_和相关资源已经被销毁时,不会仍然保持为true。 - 请考虑
close_buffer()在!connected_时是否真的应该是 no‑op(空操作);如果该函数可能在connected_被切换为false后、但缓冲区仍然存在的析构/清理阶段被调用,那么这个新增加的保护条件可能会跳过必要的清理,从而导致资源泄漏或处于不一致的状态。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- Now that `connected_` is the source of truth for `connected()`, double‑check all code paths that create/destroy the Wayland connection (e.g., destructor, error paths in `open`, failures in `bind_protocol`/`prepare_device`) to ensure `connected_` is kept in sync with the actual connection state and cannot remain `true` when `display_` and related resources are already torn down.
- Consider whether `close_buffer()` should really be a no‑op when `!connected_`; if this function might be called during teardown after `connected_` is flipped to `false` but while a buffer still exists, this new guard could skip necessary cleanup and leak or leave resources in an inconsistent state.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进之后的评审。
Original comment in English
Hey - I've left some high level feedback:
- Now that
connected_is the source of truth forconnected(), double‑check all code paths that create/destroy the Wayland connection (e.g., destructor, error paths inopen, failures inbind_protocol/prepare_device) to ensureconnected_is kept in sync with the actual connection state and cannot remaintruewhendisplay_and related resources are already torn down. - Consider whether
close_buffer()should really be a no‑op when!connected_; if this function might be called during teardown afterconnected_is flipped tofalsebut while a buffer still exists, this new guard could skip necessary cleanup and leak or leave resources in an inconsistent state.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that `connected_` is the source of truth for `connected()`, double‑check all code paths that create/destroy the Wayland connection (e.g., destructor, error paths in `open`, failures in `bind_protocol`/`prepare_device`) to ensure `connected_` is kept in sync with the actual connection state and cannot remain `true` when `display_` and related resources are already torn down.
- Consider whether `close_buffer()` should really be a no‑op when `!connected_`; if this function might be called during teardown after `connected_` is flipped to `false` but while a buffer still exists, this new guard could skip necessary cleanup and leak or leave resources in an inconsistent state.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
增加对 WlRoots 控制器连接的额外检查。
Summary by Sourcery
收紧对 Wayland wlroots 客户端连接的处理方式,并基于受跟踪的连接状态来控制各类操作。
Bug 修复:
增强项:
connected_标志,并将其作为连接状态的唯一可信来源,而不是从 display 指针中推断状态。Original summary in English
Summary by Sourcery
Tighten Wayland wlroots client connection handling and gate operations on a tracked connection state.
Bug Fixes:
Enhancements: