File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,14 @@ proto.destroy = function() {
318
318
319
319
this . glplot = null ;
320
320
this . stopped = true ;
321
+
322
+ var traces = this . traces
323
+ if ( traces ) {
324
+ Object . keys ( traces ) . map ( function ( key ) {
325
+ traces [ key ] . dispose ( ) ;
326
+ traces [ key ] = null ;
327
+ } )
328
+ }
321
329
} ;
322
330
323
331
proto . plot = function ( fullData , calcData , fullLayout ) {
Original file line number Diff line number Diff line change @@ -809,6 +809,16 @@ plots.purge = function(gd) {
809
809
// remove modebar
810
810
if ( fullLayout . _modeBar ) fullLayout . _modeBar . destroy ( ) ;
811
811
812
+ if ( fullLayout . _plots ) {
813
+ Object . keys ( fullLayout . _plots ) . map ( function ( key ) {
814
+ var plot = fullLayout . _plots [ key ] ;
815
+ if ( plot . _scene2d ) {
816
+ plot . _scene2d . destroy ( ) ;
817
+ plot . _scene2d = null ;
818
+ }
819
+ } ) ;
820
+ }
821
+
812
822
// data and layout
813
823
delete gd . data ;
814
824
delete gd . layout ;
You can’t perform that action at this time.
0 commit comments