Corrected wrong calls from .on to .off (#24575) (#26805)

Closing memory leak
This commit is contained in:
Tim Roes 2018-12-07 14:30:02 +01:00 committed by GitHub
parent bb79d69a53
commit 30de693d84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,9 +65,9 @@ class FlotChart extends Component {
shutdownChart() {
if (!this.plot) return;
$(this.target).unbind('plothover', this.props.plothover);
if (this.props.onMouseOver) $(this.target).on('plothover', this.handleMouseOver);
if (this.props.onMouseLeave) $(this.target).on('mouseleave', this.handleMouseLeave);
$(this.target).off('plothover', this.props.plothover);
if (this.props.onMouseOver) $(this.target).off('plothover', this.handleMouseOver);
if (this.props.onMouseLeave) $(this.target).off('mouseleave', this.handleMouseLeave);
if (this.props.onBrush) $(this.target).off('plotselected', this.brushChart);
this.plot.shutdown();
if (this.props.crosshair) {