antvis/G2

wx-f2调用chart.destory销毁图实例,影响隐藏页面的图的更新,怎么解决? #5218

13025168803 posted onGitHub

  • I have searched the issues of this repository and believe that this is not a duplicate.

Edit on CodeSandbox

Steps to reproduce

我在微信小程序中使用wx-f2, 会在每个页面销毁前会调用chart.destory方法。 但是存在一种情况,如果从页面A内部链接跳到页面B(此时A页面隐藏,未被销毁), wx.navigateBack返回页面A时,调用chart.destory销毁页面B的图,返回A时,发现A的图改变数据后不能正常更新,定位发现调用chart.destory会把公共变量timeline的playing置为false, 导致页面A的图不能调用到requestAnimationFrame方法。 请问下这种情况怎么解决呢?页面销毁是否需要手动调用chart.destory来防止内存泄漏呢?

辛苦各位大佬帮忙解惑

Environment Info
g2 5.0.13
System -
Browser -

<!-- generated by antv-issue-helper. DO NOT REMOVE -->


Fund this Issue

$0.00
Funded

Pull requests