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

Closing memory leak
This commit is contained in:
szydan 2018-12-07 12:36:53 +00:00 committed by Tim Roes
parent b3bd950400
commit 5ed3233fdd

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) {