-
Notifications
You must be signed in to change notification settings - Fork 486
Add cc.textureCache.addImageAsync API to ensure API consistency #1507
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
Comments
#1507: [JSB] Refactor addImageAsync to support remote image loading
The |
cc.textureCache.addImageAsync cause crashed on Android v4.4.4 with unpublished cocos2d-js v3.5 at working fine on Mac, iOS crashed for first time then not crash after that. Tested with code below :
|
Thank you, I reproduced an issue, was the crash you met triggered by the following line ?
|
There is no error show on the console log in Cocos Code IDE 1.2.0 when debug with Android device, working fine on Mac. Is there any setup to show the error log? |
I think the problem is due to thread & curl & Spidermonkey, I will try to find a more reliable solution |
ok, thanks. |
I can confirm that there is some bug in the line: It crashes often on android and rarely on iOS Do you have any fix for this? |
Thanks for your report on the problem. @pandamicro have you found any solution? Thanks. |
I think this problem is caused by thread safe. I didn't look into the code. is
|
Yes, it's caused by another thread invoking JS API. I will try |
For the web engine,
cc.textureCache.addImage
is always asynchronous, so we have mergedaddImage
andaddImageAsync
API. But it turns out the difference ofaddImage
andaddImageAsync
cannot be ignored.So it's better to do the following:
addImageAsync
API which is equivalent toaddImage
addImage
binding toaddImageAsync
, then expose the original synchronousaddImage
APIThe text was updated successfully, but these errors were encountered: