Skip to content

Commit d100eb8

Browse files
authoredApr 12, 2020
fix: destroy _resizeObject to avoid potential memory leak (#62)
1 parent 2f6c090 commit d100eb8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/components/ResizeObserver.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export default {
3636
if (!isIE && this._resizeObject.contentDocument) {
3737
this._resizeObject.contentDocument.defaultView.removeEventListener('resize', this.compareAndNotify)
3838
}
39-
delete this._resizeObject.onload
39+
this.$el.removeChild(this._resizeObject)
40+
this._resizeObject.onload = null
41+
this._resizeObject = null
4042
}
4143
},
4244
},

0 commit comments

Comments
 (0)
Please sign in to comment.