Skip to content

Commit

Permalink
Merge pull request #443 from pedrolamas/pedrolamas/fix-function
Browse files Browse the repository at this point in the history
fix: check for `eachOtherLayer` before invoke
  • Loading branch information
pissang authored Mar 1, 2022
2 parents 5ad547a + 5c50e09 commit 4dfc375
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/echarts-gl.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,13 @@ echarts.registerPostInit(function (chart) {
var oldDispose = zr.painter.dispose;

zr.painter.dispose = function () {
this.eachOtherLayer(function (layer) {
if (layer instanceof LayerGL) {
layer.dispose();
}
});
if (typeof this.eachOtherLayer === 'function') {
this.eachOtherLayer(function (layer) {
if (layer instanceof LayerGL) {
layer.dispose();
}
});
}
oldDispose.call(this);
}
zr.painter.getRenderedCanvas = function (opts) {
Expand Down

0 comments on commit 4dfc375

Please sign in to comment.