Skip to content

process cannot exit#371

Open
pointertobios wants to merge 1 commit into
x-ege:masterfrom
pointertobios:bugfix/process-cannot-exit
Open

process cannot exit#371
pointertobios wants to merge 1 commit into
x-ege:masterfrom
pointertobios:bugfix/process-cannot-exit

Conversation

@pointertobios

@pointertobios pointertobios commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

进程在窗口关闭后由于关闭事件实际上没有成功分发,导致进程无法退出。

这是我引入 std::thread 并在 _graph_setting 析构时 join thread 暴露出来的问题,之前可能进程都是异常退出的。

顺便把 messageloopthread 这个没有必要的 LPVOID 参数直接改成 _graph_setting *

Summary by CodeRabbit

  • Bug Fixes
    • 优化了窗口关闭时的处理流程,提升了关闭响应的一致性。
    • 改进了图形相关后台处理的参数传递与执行顺序,减少潜在异常。

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

概览

src/graphics.cpp 进行了三处小改动:将 messageloopthread 的参数类型从 LPVOID 改为 _graph_setting*(前置声明与函数定义同步更新),将 MSG msg 声明移至初始化逻辑之后,并在 WM_CLOSE 分支的 callback_close() 调用后直接返回 DefWindowProcW

变更内容

线程签名清理与关闭消息控制流修复

Layer / File(s) Summary
messageloopthread 签名与 MSG 声明调整
src/graphics.cpp
前置声明(第 102 行)与函数定义头(第 956–957 行)均将参数由 LPVOID 改为 _graph_setting*,去除内部强转;MSG msg 声明(第 982 行)移至初始化逻辑之后。
WM_CLOSE 返回路径修复
src/graphics.cpp
callback_close() 执行后立即 return DefWindowProcW(...),修正了关闭消息的后续控制流路径(第 624 行)。

估算代码审查工作量

🎯 2 (Simple) | ⏱️ ~8 minutes

小诗

🐇 兔子跳过旧强转,
LPVOID 换新衣裳,
MSG 挪个好位置,
关闭消息归正路,
代码简洁春风爽! 🌸

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题直接反映了本次修复的核心问题:窗口关闭后进程无法退出。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@augmentcode

augmentcode Bot commented Jun 30, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Ensures the graphics window close event reaches default processing so the UI message-loop thread can terminate and the process exits cleanly.

Changes: Forwards WM_CLOSE to DefWindowProcW even when callback_close is set, and types messageloopthread to take _graph_setting* directly to match the std::thread entrypoint.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode 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.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
src/graphics.cpp (1)

102-102: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

messageloopthread 放进 ege 命名空间。

这两个实现点现在仍然暴露在全局命名空间里,不符合仓库对 C/C++ 实现位置的约束。As per coding guidelines, **/*.{h,hpp,cpp,cc,cxx}: All implementations must be in ege namespace, with public API in global namespace.

Also applies to: 956-956

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/graphics.cpp` at line 102, `messageloopthread` is still declared in the
global namespace, but this implementation must live under `ege` per the
repository namespace rule. Move the declaration/definition into the `ege`
namespace in the graphics implementation, and update any related references in
the same area so the internal implementation stays namespaced while the public
API remains global.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/graphics.cpp`:
- Line 102: `messageloopthread` is still declared in the global namespace, but
this implementation must live under `ege` per the repository namespace rule.
Move the declaration/definition into the `ege` namespace in the graphics
implementation, and update any related references in the same area so the
internal implementation stays namespaced while the public API remains global.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0ce2b869-2fdc-4e96-866e-65a782d52fc1

📥 Commits

Reviewing files that changed from the base of the PR and between e85aa27 and 60abb58.

📒 Files selected for processing (1)
  • src/graphics.cpp

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.

2 participants