Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c123ebc

Browse filesBrowse files
committed
Memory leak fix candidates: 1) purge must destroy scene2d otherwise rAF never stops; 2) scene2d.destroy should destroy the traces
(cherry picked from commit 8f6f2dd)
1 parent 46bbbae commit c123ebc
Copy full SHA for c123ebc

File tree

Expand file treeCollapse file tree

2 files changed

+18
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+18
-0
lines changed

‎src/plots/gl2d/scene2d.js

Copy file name to clipboardExpand all lines: src/plots/gl2d/scene2d.js
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,14 @@ proto.destroy = function() {
318318

319319
this.glplot = null;
320320
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+
}
321329
};
322330

323331
proto.plot = function(fullData, calcData, fullLayout) {

‎src/plots/plots.js

Copy file name to clipboardExpand all lines: src/plots/plots.js
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,16 @@ plots.purge = function(gd) {
809809
// remove modebar
810810
if(fullLayout._modeBar) fullLayout._modeBar.destroy();
811811

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+
812822
// data and layout
813823
delete gd.data;
814824
delete gd.layout;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.