fix: 安全审查 P0-P2 问题修复(26项)
P0 关键修复: - 移除 exit(0) 强制退出,改为应用语言设置后下次启动生效 - 修复 LivePhotoValidator hasResumed data race,引入线程安全 ResumeOnce - 修复 addAssetID(toVideo:) continuation 泄漏,添加 writer/reader 启动状态检查 - 修复 OnboardingView "跳过" 按钮未国际化 - 修复 LanguageManager "跟随系统" 硬编码中文 - .gitignore 补全 AI 工具目录 P1 架构与 UI 修复: - 修复 RealESRGANProcessor actor 隔离违规 - 修复 ODRManager continuation 生命周期保护 - TiledImageProcessor 改为流式拼接,降低内存峰值 - EditorView 硬编码颜色统一为设计系统 - ProcessingView 取消导航竞态修复 - 反馈诊断包添加知情同意提示 P2 代码质量与合规: - EditorView/WallpaperGuideView 硬编码间距圆角统一为设计令牌 - PrivacyPolicyView 设计系统颜色统一 - HomeView 重复 onChange 合并 - PHAuthorizationStatus 改为英文技术术语 - Analytics 日志 assetId 脱敏 - 隐私政策补充 localIdentifier 存储说明 - 清理孤立的 subscription 翻译 key - 脚本硬编码绝对路径改为相对路径 - DesignSystem SoftSlider 类型不匹配编译错误修复 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -155,11 +155,13 @@ public actor ODRManager {
|
||||
private func checkODRAvailability() async -> Bool {
|
||||
// Use conditionallyBeginAccessingResources to check without triggering download
|
||||
let request = NSBundleResourceRequest(tags: [Self.modelTag])
|
||||
|
||||
|
||||
return await withCheckedContinuation { continuation in
|
||||
request.conditionallyBeginAccessingResources { available in
|
||||
request.conditionallyBeginAccessingResources { [request] available in
|
||||
// Capture request explicitly to prevent ARC from releasing it
|
||||
// before the callback fires
|
||||
_ = request
|
||||
if available {
|
||||
// Model is already downloaded via ODR
|
||||
self.logger.debug("ODR model is available locally")
|
||||
}
|
||||
continuation.resume(returning: available)
|
||||
|
||||
Reference in New Issue
Block a user