Skip to content

Commit

Permalink
fix(devtools): clear devtools buffer after timeout
Browse files Browse the repository at this point in the history
fix #4738
  • Loading branch information
yyx990803 committed Oct 7, 2021
1 parent 646e694 commit f4639e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/runtime-core/src/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export function setDevtoolsHook(hook: DevtoolsHook, target: any) {
replay.push((newHook: DevtoolsHook) => {
setDevtoolsHook(newHook, target)
})
// clear buffer after 3s - the user probably doesn't have devtools installed
// at all, and keeping the buffer will cause memory leaks (#4738)
setTimeout(() => {
buffer = []
}, 3000)
}
}

Expand Down

0 comments on commit f4639e0

Please sign in to comment.