From 49d6f8db2f8d460636e22383cba69b6b39210899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 6 Oct 2026 18:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=A1=A8=E5=8D=95=E7=99=BB?= =?UTF-8?q?=E8=AE=B0=E6=88=AA=E5=9B=BE=E9=A2=84=E8=A7=88=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - useGameDistributionPublishForm 的 createPanelScreenshotEntry 把生成的 blob 地址加入 objectUrlsRef,删除截图与卸载时的回收分支终于能命中 --- .../game-distribution/useGameDistributionPublishForm.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src/components/game-distribution/useGameDistributionPublishForm.ts b/apps/ai-game-creator-shell/src/components/game-distribution/useGameDistributionPublishForm.ts index 3584d74f1..d419eed5e 100644 --- a/apps/ai-game-creator-shell/src/components/game-distribution/useGameDistributionPublishForm.ts +++ b/apps/ai-game-creator-shell/src/components/game-distribution/useGameDistributionPublishForm.ts @@ -428,10 +428,14 @@ export function useGameDistributionPublishForm({ function createPanelScreenshotEntry(file: File): PanelScreenshotEntry { const fileError = resolvePanelImageFileError(file, 'screenshot'); + const previewUrl = buildPanelImagePreviewUrl(file); + // 与封面走同一条登记:不登记的话 `removeScreenshot` 的 revoke 分支永远命中不了, + // 卸载清理也遍历不到这些地址,截图预览会一直泄漏到页面关闭。 + if (previewUrl) objectUrlsRef.current.add(previewUrl); return { id: createPanelScreenshotId(), name: file.name.trim() || '游戏截图', - previewUrl: buildPanelImagePreviewUrl(file), + previewUrl, assetObjectId: null, status: fileError ? 'failed' : 'uploading', error: fileError || null,