projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
79b3ee4
)
fix memory leak when gviz.draw() is called repeatedly
author
Dan Vanderkam
<danvk@google.com>
Mon, 1 Nov 2010 17:58:25 +0000
(10:58 -0700)
committer
Dan Vanderkam
<danvk@google.com>
Mon, 1 Nov 2010 17:58:25 +0000
(10:58 -0700)
dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph.js
b/dygraph.js
index
b909aa7
..
51e656c
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-2922,7
+2922,14
@@
Dygraph.GVizChart = function(container) {
}
Dygraph.GVizChart.prototype.draw = function(data, options) {
+ // Clear out any existing dygraph.
+ // TODO(danvk): would it make more sense to simply redraw using the current
+ // date_graph object?
this.container.innerHTML = '';
+ if (typeof(this.date_graph) != 'undefined') {
+ this.date_graph.destroy();
+ }
+
this.date_graph = new Dygraph(this.container, data, options);
}