You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2019/11/11 11:07:35 UTC

[GitHub] [incubator-echarts] szkissyh edited a comment on issue #11615: IOS 一个页面切换地理坐标图时报错:TypeError:null is not an object(evaluating 'this.ctx.dpr=this.dpr')

szkissyh edited a comment on issue #11615: IOS 一个页面切换地理坐标图时报错:TypeError:null is not an object(evaluating 'this.ctx.dpr=this.dpr')
URL: https://github.com/apache/incubator-echarts/issues/11615#issuecomment-552393085
 
 
   > 一般这种错误是 dispose 后继续使用 chart 实例造成的,@szkissyh 建议再排查一下,同时也可以整理一个可以最小复现的 demo 发给我们
   
   我发现了问题,并且可以复现,问题的核心是同样一个世界地图模型,在横屏和竖屏模式下占用的内存相差很多。
   横屏模式占用内存较少,**为18M**
   ![image](https://user-images.githubusercontent.com/31839257/68581680-d9ebfc80-04b3-11ea-899c-c0d2fb66be30.png)
   竖屏模式占用内存较多,**为49M**
   ![image](https://user-images.githubusercontent.com/31839257/68581720-f1c38080-04b3-11ea-896e-e9b8159b7d25.png)
   
   而我们操作多为竖屏操作,多次操作后出现total canvas memory use exceeds the maximum limit,超出了safari支持的最大canvas内存支持(我的为384MB)
   
   释放代码为
   var chart = echarts.getInstanceByDom(document.getElementById("container"));
   if (chart) {
   	chart.dispose();
   	chart = null;
   }
   重新初始化代码为
    var chart=echarts.getInstanceByDom(document.getElementById("container"));
   if(!chart || chart.isDisposed()) {
   	chart = echarts.init(document.getElementById("container"));
   }
   
   同样的代码,竖屏多次操作,没有任何问题。但是横屏就会报出TypeError:null is not an object(evaluating 'this.ctx.dpr=this.dpr')
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org