fix(python): 修复 Context.wait_freezes 的 Rect 句柄传递,改用 RectBuffer 管理#1175
Merged
fix(python): 修复 Context.wait_freezes 的 Rect 句柄传递,改用 RectBuffer 管理#1175
Conversation
Contributor
There was a problem hiding this comment.
嘿,我已经审查了你的修改,看起来很棒!
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进之后的评审。
Original comment in English
Hey - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
MistEO
reviewed
Mar 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Python binding for Context.wait_freezes to correctly manage the lifecycle of the native Rect handle passed into MaaContextWaitFreezes, avoiding invalid handle usage and ensuring cleanup.
Changes:
- Allocate the ROI rect via
MaaRectCreate()instead of constructing actypeshandle directly. - Ensure the rect handle is always released via
MaaRectDestroy()in afinallyblock. - Early-return
Falseif rect creation fails.
MistEO
reviewed
Mar 4, 2026
MistEO
approved these changes
Mar 4, 2026
Member
|
等一个 CI |
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.
Summary by Sourcery
Bug Fixes:
finally块中销毁它们,修复了Context.wait_freezes中 Rect 句柄的生命周期问题。Original summary in English
Summary by Sourcery
Bug Fixes: