Skip to content

Commit

Permalink
Corrected wrong calls from .on to .off (elastic#24575) (elastic#26805)
Browse files Browse the repository at this point in the history
Closing memory leak
  • Loading branch information
timroes authored Dec 7, 2018
1 parent bb79d69 commit 30de693
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 30de693

Please sign in to comment.