Commit 6f294ced authored by Thodoris Greasidis's avatar Thodoris Greasidis

Added plot.destroy() method, to properly destruct and release memory of a plot.

parent 0360316e
...@@ -658,6 +658,23 @@ Licensed under the MIT license. ...@@ -658,6 +658,23 @@ Licensed under the MIT license.
}; };
}; };
plot.shutdown = shutdown; plot.shutdown = shutdown;
plot.destroy = function () {
shutdown();
placeholder.removeData("plot").empty();
series = [];
options = null;
surface = null;
overlay = null;
eventHolder = null;
ctx = null;
octx = null;
xaxes = [];
yaxes = [];
hooks = null;
highlights = [];
plot = null;
};
plot.resize = function () { plot.resize = function () {
var width = placeholder.width(), var width = placeholder.width(),
height = placeholder.height(); height = placeholder.height();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment