Skip to content

Commit

Permalink
Fix a potential memory leak if a render step pauses for a long time. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
onnlucky authored Dec 13, 2024
1 parent 1422aef commit 47d5524
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/framer-motion/src/frameloop/render-step.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ export function createRenderStep(runNextFrame: () => void): Step {
// Execute this frame
thisFrame.forEach(triggerCallback)

// Clear the just processed frame, so we don't retain anything the callbacks retain,
// incase this step will not run for a while.
thisFrame.clear()

isProcessing = false

if (flushNextFrame) {
Expand Down

0 comments on commit 47d5524

Please sign in to comment.