Skip to content

Commit 0b120f9

Browse files
committed
make scene2d.destroy clear gl2d canvas, hover svg and mouse div
1 parent 5bdc38f commit 0b120f9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/plots/gl2d/scene2d.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,13 @@ proto.cameraChanged = function() {
292292

293293
proto.destroy = function() {
294294
this.glplot.dispose();
295+
296+
this.container.removeChild(this.canvas);
297+
this.container.removeChild(this.svgContainer);
298+
this.container.removeChild(this.mouseContainer);
299+
300+
this.glplot = null;
301+
this.stopped = true;
295302
};
296303

297304
proto.plot = function(fullData, fullLayout) {
@@ -405,6 +412,7 @@ proto.plot = function(fullData, fullLayout) {
405412

406413
proto.draw = function() {
407414
if(this.stopped) return;
415+
408416
requestAnimationFrame(this.redraw);
409417

410418
var glplot = this.glplot,

0 commit comments

Comments
 (0)