Skip to content

Commit f4639e0

Browse files
committed
fix(devtools): clear devtools buffer after timeout
fix #4738
1 parent 646e694 commit f4639e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/runtime-core/src/devtools.ts

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ export function setDevtoolsHook(hook: DevtoolsHook, target: any) {
5353
replay.push((newHook: DevtoolsHook) => {
5454
setDevtoolsHook(newHook, target)
5555
})
56+
// clear buffer after 3s - the user probably doesn't have devtools installed
57+
// at all, and keeping the buffer will cause memory leaks (#4738)
58+
setTimeout(() => {
59+
buffer = []
60+
}, 3000)
5661
}
5762
}
5863

0 commit comments

Comments
 (0)