Fixed the issue about 'Object was deleted while awaiting a callback.'#50
Fixed the issue about 'Object was deleted while awaiting a callback.'#50LingkongSky wants to merge 3 commits into
Conversation
|
Warning 此分析由 AI 自动生成,仅供开发者参考,最终判断请以人工确认为准。如有疑问建议结合本地环境进一步复现确认。 摘要本 PR 在 重点结论
展开详细审阅、证据与验证变更概要
变更属纯粹防御性修复,不引入新状态、不改变 UI 构建逻辑,仅在两个后台任务调用点外包一层异常观察器。 PR 说明与代码对照PR body 列出的三项变更点:
详细代码审阅根本原因链路 该异常在 修复实现(新增,约 19 行) private void ObserveBackgroundUiTask(Task task, string operation)
{
_ = ObserveBackgroundUiTaskAsync(task, operation);
}
private static async Task ObserveBackgroundUiTaskAsync(Task task, string operation)
{
try { await task; }
catch (OperationCanceledException)
{
// Normal when the submenu is closed or freed between deferred frame waits.
}
catch (Exception ex)
{
RitsuLibFramework.Logger.Warn($"[Settings] Background UI task '{operation}' failed: {ex.Message}");
}
}
修改的调用点
详细验证建议
合并与回滚风险
English translationSummaryThis PR adds Key Takeaways
Expand detailed analysis, evidence, and verificationChange overview
The change is purely defensive: no new state, no UI build logic changes, only an exception observer wrapper added at two task call sites. PR description vs. diff
Detailed code reviewRoot cause chain This exception bubbles up through Fix implementation (new, ~19 lines) private void ObserveBackgroundUiTask(Task task, string operation)
{
_ = ObserveBackgroundUiTaskAsync(task, operation);
}
private static async Task ObserveBackgroundUiTaskAsync(Task task, string operation)
{
try { await task; }
catch (OperationCanceledException)
{
// Normal when the submenu is closed or freed between deferred frame waits.
}
catch (Exception ex)
{
RitsuLibFramework.Logger.Warn($"[Settings] Background UI task '{operation}' failed: {ex.Message}");
}
}
Modified call sites
Detailed verification checklist
Merge and rollback risk
工具侧记录
|
Summary / 概要
Why / 背景与动机
What changed / 变更点
Test plan / 测试计划
Notes / 备注