mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 01:09:46 +00:00
Fix memory leak in preview code (#2012)
Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
This commit is contained in:
@@ -110,6 +110,9 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (progressPreviewBlobUrl.value) {
|
||||
URL.revokeObjectURL(progressPreviewBlobUrl.value)
|
||||
}
|
||||
api.removeEventListener('b_preview', onProgressPreviewReceived)
|
||||
})
|
||||
|
||||
@@ -164,6 +167,9 @@ const formatTime = (time?: number) => {
|
||||
|
||||
const onProgressPreviewReceived = async ({ detail }: CustomEvent) => {
|
||||
if (props.task.displayStatus === TaskItemDisplayStatus.Running) {
|
||||
if (progressPreviewBlobUrl.value) {
|
||||
URL.revokeObjectURL(progressPreviewBlobUrl.value)
|
||||
}
|
||||
progressPreviewBlobUrl.value = URL.createObjectURL(detail)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user