fix(PKG-AUTO-THUMB-11): isolate frame handler cleanup failures

This commit is contained in:
Harvey Zhao committed 2026-09-14 14:22:45 +08:00
1 parent a8d19ce5ef
commit eb6402fdca
16 files changed
+2892 -36

No files matched your search

@@ -165,17 +165,19 @@ function createFrameReader(job, video) {
function clear() {
const previous = pending;
pending = void 0;
video.onloadeddata = null;
video.onseeked = null;
if (!previous)
return;
const result = cleanupAll([
() => {
if (previous.timer !== null)
video.onloadeddata = null;
},
() => {
video.onseeked = null;
},
() => {
if (previous && previous.timer !== null)
clearTimeout(previous.timer);
},
() => {
if (previous.frame !== null)
if (previous && previous.frame !== null)
video.cancelVideoFrameCallback(previous.frame);
}
]);