Commits

Anonymous committed 9ab9a74

Release temporary references to js objects, may have some impact on memory usage.

Comments (0)

Files changed (3)

src/jqplot.lineRenderer.js

         plot.plugins.lineRenderer.highlightedSeriesIndex = sidx;
         var opts = {fillStyle: s.highlightColor};
         s.renderer.shapeRenderer.draw(canvas._ctx, points, opts);
+        canvas = null;
     }
     
     function unhighlight (plot) {
         }
         plot.plugins.lineRenderer.highlightedSeriesIndex = null;
         plot.target.trigger('jqplotDataUnhighlight');
+        canvas = null;
     }
     
     

src/plugins/jqplot.barRenderer.js

         this.plugins.barRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
         
         this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-barRenderer-highlight-canvas', this._plotDimensions));
-        var hctx = this.plugins.barRenderer.highlightCanvas.setContext();
+        this.plugins.barRenderer.highlightCanvas.setContext();
     }   
     
     function highlight (plot, sidx, pidx, points) {
         plot.plugins.barRenderer.highlightedSeriesIndex = sidx;
         var opts = {fillStyle: s.highlightColors[pidx]};
         s.renderer.shapeRenderer.draw(canvas._ctx, points, opts);
+        canvas = null;
     }
     
     function unhighlight (plot) {
         }
         plot.plugins.barRenderer.highlightedSeriesIndex = null;
         plot.target.trigger('jqplotDataUnhighlight');
+        canvas =  null;
     }
     
     

src/plugins/jqplot.highlighter.js

         this.plugins.highlighter.highlightCanvas = new $.jqplot.GenericCanvas();
         
         this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding, 'jqplot-highlight-canvas', this._plotDimensions));
-        var hctx = this.plugins.highlighter.highlightCanvas.setContext();
+        this.plugins.highlighter.highlightCanvas.setContext();
         
         var p = this.plugins.highlighter;
         p._tooltipElem = $('<div class="jqplot-highlighter-tooltip" style="position:absolute;display:none"></div>');
         else {
             elem.show();
         }
+        elem = null;
         
     }
     
                     plot.restorePreviousSeriesOrder();
                 }
                hl.isHighlighting = false;
+        	  ctx = null;
             
             }
             if (neighbor != null && plot.series[neighbor.seriesIndex].showHighlight && !hl.isHighlighting) {