I just upgraded from 2.0.4 to 3.0 alpha1 for the better multi-project support. I have been getting an off-and-on again crash with the TextureCache as a result of using Sprites. Here’s a snippet of my code where this problem starts:
Sprite* dialogSprite = Sprite::create("dialog_exitconfirm.png");
Here’s the stack trace:
ntdll.dll!77080574() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!7703b0b2() Unknown
ntdll.dll!76fe3cfe() Unknown
ntdll.dll!76fe3cfe() Unknown
ntdll.dll!76fe3cfe() Unknown
ntdll.dll!7708106e() Unknown
msvcr110d.dll!_heap_alloc_base(unsigned int size) Line 57 C
msvcr110d.dll!_heap_alloc_dbg_impl(unsigned int nSize, int nBlockUse, const char * szFileName, int nLine, int * errno_tmp) Line 431 C++
msvcr110d.dll!_nh_malloc_dbg_impl(unsigned int nSize, int nhFlag, int nBlockUse, const char * szFileName, int nLine, int * errno_tmp) Line 239 C++
msvcr110d.dll!_nh_malloc_dbg(unsigned int nSize, int nhFlag, int nBlockUse, const char * szFileName, int nLine) Line 302 C++
msvcr110d.dll!malloc(unsigned int nSize) Line 56 C++
msvcr110d.dll!operator new(unsigned int size) Line 59 C++
TreatWorld.exe!std::_Allocate,std::allocator > const ,cocos2d::Texture2D *>,void *> >(unsigned int _Count, std::_List_node,std::allocator > const ,cocos2d::Texture2D *>,void *> * __formal) Line 28 C++
TreatWorld.exe!std::allocator,std::allocator > const ,cocos2d::Texture2D *>,void *> >::allocate(unsigned int _Count) Line 591 C++
TreatWorld.exe!std::_Wrap_alloc,std::allocator > const ,cocos2d::Texture2D *>,void *> > >::allocate(unsigned int _Count) Line 877 C++
TreatWorld.exe!std::_List_alloc<0,std::_List_base_types,std::allocator > const ,cocos2d::Texture2D *>,std::allocator,std::allocator > const ,cocos2d::Texture2D *> > > >::_Buynode0(std::_List_node,std::allocator > const ,cocos2d::Texture2D *>,void *> * _Next, std::_List_node,std::allocator > const ,cocos2d::Texture2D *>,void *> * _Prev) Line 788 C++
TreatWorld.exe!std::_List_buy,std::allocator > const ,cocos2d::Texture2D *>,std::allocator,std::allocator > const ,cocos2d::Texture2D *> > >::_Buynode,std::allocator >,cocos2d::Texture2D *> >(std::_List_node,std::allocator > const ,cocos2d::Texture2D *>,void *> * _Next, std::_List_node,std::allocator > const ,cocos2d::Texture2D *>,void *> * _Prev, std::pair,std::allocator >,cocos2d::Texture2D *> && _V0) Line 850 C++
TreatWorld.exe!std::list,std::allocator > const ,cocos2d::Texture2D *>,std::allocator,std::allocator > const ,cocos2d::Texture2D *> > >::_Insert,std::allocator >,cocos2d::Texture2D *> >(std::_List_unchecked_const_iterator,std::allocator > const ,cocos2d::Texture2D *> > >,std::_Iterator_base0> _Where, std::pair,std::allocator >,cocos2d::Texture2D *> && _V0) Line 1086 C++
TreatWorld.exe!std::list,std::allocator > const ,cocos2d::Texture2D *>,std::allocator,std::allocator > const ,cocos2d::Texture2D *> > >::emplace_front,std::allocator >,cocos2d::Texture2D *> >(std::pair,std::allocator >,cocos2d::Texture2D *> && _V0) Line 1086 C++
TreatWorld.exe!std::_Hash,std::allocator >,cocos2d::Texture2D *,std::_Uhash_compare,std::allocator >,std::hash,std::allocator > >,std::equal_to,std::allocator > > >,std::allocator,std::allocator > const ,cocos2d::Texture2D *> >,0> >::insert,std::allocator >,cocos2d::Texture2D *> >(std::pair,std::allocator >,cocos2d::Texture2D *> && _Val) Line 385 C++
> TreatWorld.exe!cocos2d::TextureCache::addImage(const std::basic_string,std::allocator > & path) Line 314 C++
TreatWorld.exe!cocos2d::Sprite::initWithFile(const std::basic_string,std::allocator > & filename) Line 222 C++
TreatWorld.exe!cocos2d::Sprite::create(const std::basic_string,std::allocator > & filename) Line 88 C++
TreatWorld.exe!stf::ExitConfirmDialog::ExitConfirmDialog(gnelson_coretech::IDialogListener * listener, stf::Decoration * buttonNoData, stf::Decoration * buttonYesData) Line 24 C++
It looks like it starts to freak out around the time it enters the STD library. I’m using VS 2012, but this happens on the Mac version as well. It’s just easier to debug in Windows