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 2020/12/04 10:10:01 UTC

[GitHub] [incubator-echarts] ztytotoro commented on issue #13743: [echarts-gl] Undisposed zrender instance

ztytotoro commented on issue #13743:
URL: https://github.com/apache/incubator-echarts/issues/13743#issuecomment-738696053


   Sorry, I read the code, `chart.getZr()` will return the zr instance create by  [here](https://github.com/apache/incubator-echarts/blob/88bf43cb849e13cc6ee8d6ffd6811efdb3dc09a7/src/echarts.ts#L397)
   
   but [echarts-gl\src\util\ZRTextureAtlasSurface.js(193)](https://github.com/ecomfe/echarts-gl/blob/7cc547c903ac0f091b5736c19c15561bd0f21090/src/util/ZRTextureAtlasSurface.js#L193) will call `zrender.init` to create a new zr instance
   
   so when I call `chart.dispose()`, only `chart._zr` wiil be disposed.
   
   e.g. the bar3D will [create a labelsBuilder](https://github.com/ecomfe/echarts-gl/blob/7cc547c903ac0f091b5736c19c15561bd0f21090/src/chart/bar3D/Bar3DView.js#L22), and the labelsBuilder create a [ZRTextureAtlasSurface](https://github.com/ecomfe/echarts-gl/blob/7cc547c903ac0f091b5736c19c15561bd0f21090/src/component/common/LabelsBuilder.js#L13), the ZRTextureAtlasSurface create a zr instance, however, when chart is disposed, Bar3DView will not dispose labelsBuilder
   
   I didn't read all the code, maybe I missed something, but I did solved my problem when I added the missing dispose methods


----------------------------------------------------------------
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



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