aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay <[email protected]>2023-03-24 15:51:36 -0400
committerAjay <[email protected]>2023-03-24 15:51:36 -0400
commit6d7953a1ca4083e533976163b6933c26bf218590 (patch)
tree0140178f3f57b1d4030459311da60765323698e9
parentc1a61b97957f912f8f0f165bd2e765bc7b2df269 (diff)
downloadSponsorBlock-6d7953a1ca4083e533976163b6933c26bf218590.tar.gz
SponsorBlock-6d7953a1ca4083e533976163b6933c26bf218590.zip
Fix potentially leaking set interval
-rw-r--r--src/content.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/content.ts b/src/content.ts
index 1f1315ea..e013099b 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -684,6 +684,7 @@ async function startSponsorSchedule(includeIntersectingSegments = false, current
const reportedVideoTimeAtStart = getVideo().currentTime;
logDebug(`Starting setInterval skipping ${getVideo().currentTime} to skip at ${skipTime[0]}`);
+ if (currentSkipInterval !== null) clearInterval(currentSkipInterval);
currentSkipInterval = setInterval(() => {
// Estimate delay, but only take the current time right after a change
// Current time remains the same for many "frames" on Firefox