File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,12 @@ export let devtools: DevtoolsHook
33
33
34
34
let buffer : { event : string ; args : any [ ] } [ ] = [ ]
35
35
36
+ let devtoolsNotInstalled = false
37
+
36
38
function emit ( event : string , ...args : any [ ] ) {
37
39
if ( devtools ) {
38
40
devtools . emit ( event , ...args )
39
- } else {
41
+ } else if ( ! devtoolsNotInstalled ) {
40
42
buffer . push ( { event, args } )
41
43
}
42
44
}
@@ -56,7 +58,10 @@ export function setDevtoolsHook(hook: DevtoolsHook, target: any) {
56
58
// clear buffer after 3s - the user probably doesn't have devtools installed
57
59
// at all, and keeping the buffer will cause memory leaks (#4738)
58
60
setTimeout ( ( ) => {
59
- buffer = [ ]
61
+ if ( ! devtools ) {
62
+ devtoolsNotInstalled = true
63
+ buffer = [ ]
64
+ }
60
65
} , 3000 )
61
66
}
62
67
}
You can’t perform that action at this time.
0 commit comments