-
Notifications
You must be signed in to change notification settings - Fork 320
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
call pendingDestroy when add image #117
Conversation
👍 good catch, a potential bug of memory leak. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could please change to image.addToCache()
I don't recommend add this image to cache because we already add image to textureManager, will become more heavier. What do you think? 😁 |
only a diffenent between them is, so actually they are the same, but use Phaser's API is more sensible because you don't knwo whether they will be changed in the furture or not, right? |
You're right, I've changed to addToCache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you forgot to remove line this.loader.textureManager.addImage(image.key, image.data);
, as it becomes useless now. 🍭
Sorry for misunderstand your suggest, fixed and refresh output files at newest commit. |
thanks for your effort @taoabc 👍 |
Call json.addToCache will call pendingDestroy internally, but add image to textureManager will not, so I call pendingDestroy manually.