File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -121,8 +121,9 @@ export class EffectScope {
121
121
for ( i = 0 , l = this . effects . length ; i < l ; i ++ ) {
122
122
this . effects [ i ] . stop ( )
123
123
}
124
- for ( i = 0 , l = this . cleanups . length ; i < l ; i ++ ) {
125
- this . cleanups [ i ] ( )
124
+ const cleanups = this . cleanups . slice ( )
125
+ for ( i = 0 , l = cleanups . length ; i < l ; i ++ ) {
126
+ cleanups [ i ] ( )
126
127
}
127
128
if ( this . scopes ) {
128
129
for ( i = 0 , l = this . scopes . length ; i < l ; i ++ ) {
Original file line number Diff line number Diff line change @@ -215,8 +215,12 @@ export function watch(
215
215
effect . stop ( )
216
216
if ( scope ) {
217
217
remove ( scope . effects , effect )
218
+ remove ( scope . cleanups , watchHandle )
218
219
}
219
220
}
221
+ if ( scope ) {
222
+ scope . cleanups . push ( watchHandle )
223
+ }
220
224
221
225
if ( once && cb ) {
222
226
const _cb = cb
You can’t perform that action at this time.
0 commit comments