From dba517df4e62b2c252742983276e78cc2d0ffc2a Mon Sep 17 00:00:00 2001 From: cc Date: Wed, 24 Jun 2026 21:27:24 +0800 Subject: [PATCH] fix(photo-wall): clear stale photos + revoke object URLs before (re)loading Co-Authored-By: Claude Opus 4.8 --- Client/src/components/PhotoWallPage.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Client/src/components/PhotoWallPage.tsx b/Client/src/components/PhotoWallPage.tsx index fd48512..b175395 100644 --- a/Client/src/components/PhotoWallPage.tsx +++ b/Client/src/components/PhotoWallPage.tsx @@ -283,6 +283,10 @@ export function PhotoWallPage({ onExit, token }: PhotoWallPageProps) { let alive = true ;(async () => { try { + // 重新加载前清掉旧会话的照片,避免重复堆叠与 objectURL 泄漏 + for (const u of objUrls.current) URL.revokeObjectURL(u) + objUrls.current = [] + setEls((prev) => prev.filter((e) => e.type !== 'photo')) const { items } = await listPhotos(token) for (const item of items) { let url: string