Skip to content

Commit 47d5524

Browse files
authored
Fix a potential memory leak if a render step pauses for a long time. (#2944)
1 parent 1422aef commit 47d5524

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/framer-motion/src/frameloop/render-step.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export function createRenderStep(runNextFrame: () => void): Step {
8686
// Execute this frame
8787
thisFrame.forEach(triggerCallback)
8888

89+
// Clear the just processed frame, so we don't retain anything the callbacks retain,
90+
// incase this step will not run for a while.
91+
thisFrame.clear()
92+
8993
isProcessing = false
9094

9195
if (flushNextFrame) {

0 commit comments

Comments
 (0)