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

AssetLibraryBundle.removeAsset() doesn't actually remove the reference from bundle. #620

Closed
esidegallery opened this issue Aug 7, 2013 · 3 comments

Comments

@esidegallery
Copy link

AssetLibraryBundle.as Line 439: this should be changed from _assets.splice(idx, 1); to _assets = _assets.splice(idx, 1);.

Currently, getAsset will still returns the previously removed (and where applicable, disposed) asset.

@rob-bateman
Copy link
Member

The fix above doesn't appear to solve the problem. My understanding of splice() is that it returns the removed array, so the code would be deemed incorrect if what you are trying to do is replace the contents of _assets with the spliced array (splice() does this for you)

If you have a use case setup where a removed asset is still visible to the getAsset() method, i would be interested to see

@esidegallery
Copy link
Author

You're quite right. I must have been thinking of slice().

I will recheck my project when I get the chance and get back to you.

@esidegallery
Copy link
Author

I've finally found what is causing this problem. I was manually creating and populating named assets, and this exposed a namespace issue: see #698

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