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