Skip to content

Commit 418ac5b

Browse files
island205ziyoung
authored andcommitted
Select: Fix memory leak issue (#16463)
1 parent adabeff commit 418ac5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/select/src/option.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@
153153
},
154154
155155
beforeDestroy() {
156+
let index = this.select.cachedOptions.indexOf(this);
157+
if (index > -1) {
158+
this.select.cachedOptions.splice(index, 1);
159+
}
156160
this.select.onOptionDestroy(this.select.options.indexOf(this));
157161
}
158162
};

0 commit comments

Comments
 (0)