Hey guys,
When I use addImageSync it always crashes when the the game enters the foreground (after locking/unlocking or pressing the home button then going back to the app). addImage works fine though, so I think this might be a bug.
Anyone else encounter this problem?
zhangxm
December 20, 2011, 10:48pm
#2
Yes, I have checked it.
#923 is created for it.
Thank you.
zhangxm
December 20, 2011, 11:49pm
#3
Did you run TextureCacheTest then find the bug, or did you use addImageAsync in your codes?
I encountered the crash when I used addImageAsync in my game. I haven’t tried the TextureCacheTest
zhangxm
December 21, 2011, 6:54pm
#5
I have fixed it.
Please refer https://github.com/cocos2d/cocos2d-x/pull/636 for detail info.
Thanks for the quick fix man. It works well now. One thing though I think we should change line 105 in CCTextureCache from:
CCImage::EImageFormat imageType;
To:
CCImage::EImageFormat imageType = (CCImage::EImageFormat) –1; //or create something like kFmtUnknown
Cuz I got a ’variable “imageType’ is being used without being initialized” check failure when I first compiled in Visual Studio.
zhangxm
December 21, 2011, 10:15pm
#7
You are right.
Thank you.