Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource.destory()动态删除资源时报错(删除没有用到的资源) #169

Closed
WuZheXiao opened this issue Dec 15, 2021 · 6 comments

Comments

@WuZheXiao
Copy link

Expected Behavior

resource.destory(),动态删除

Current Behavior

删除resource.destory() 资源报错
WX20211215-162252

Possible Solution

是因为我还在用这个资源吗?我这边是用户长链接进来的一些头像、名称的资源,我想用户下去之后删除头像名称资源

Steps to Reproduce

WX20211215-162515
image

Environment

  • Eva.js version: e.g. 1.1.6
  • Browser & Version: e.g. Chrome 67
  • OS & Version: e.g. MacOS 10.15.7
  • Running Example: url
@fanmingfei
Copy link
Member

fanmingfei commented Dec 15, 2021

playground
在这上面写一个简单能够复现的demo,然后把代码发出来看一下

@WuZheXiao
Copy link
Author

大佬,用resource.destory()的时候是不是一定要这个资源complete等于false的时候才可以删啊

@fanmingfei
Copy link
Member

大佬,用resource.destory()的时候是不是一定要这个资源complete等于false的时候才可以删啊

不是啊

@fanmingfei
Copy link
Member

只要没有被使用 都可以删。

@fanmingfei
Copy link
Member

image
虽然 image 对象不是同一个对象,其实他底层用的baseTexture是同一个,因为PIXI的baseTexture是以url做cache的
所以 image1 image2 如果是同一个 url 的话,pixiBaseTexture 会认为是同一个资源,多个地方使用销毁一个另外一个也会被销毁

@WuZheXiao
Copy link
Author

嗯嗯,我就是钉钉那个,你把这个bug关了吧 哈哈哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants