Skip to content

Commit ed933c6

Browse files
Disconnect ResizeObserver when component unmounts to prevent memory-leak.
1 parent 2ee1691 commit ed933c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/inner-slider.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export class InnerSlider extends React.Component {
122122
if (this.autoplayTimer) {
123123
clearInterval(this.autoplayTimer);
124124
}
125+
this.ro.disconnect();
125126
};
126127
UNSAFE_componentWillReceiveProps = nextProps => {
127128
let spec = {
@@ -705,7 +706,7 @@ export class InnerSlider extends React.Component {
705706
let innerSliderProps = {
706707
className: className,
707708
dir: "ltr",
708-
style:this.props.style
709+
style: this.props.style
709710
};
710711

711712
if (this.props.unslick) {

0 commit comments

Comments
 (0)