浏览代码

Return the texture while Spine is using it.

NathanSweet 11 年之前
父节点
当前提交
4defc3146a
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      spine-cocos2dx/src/spine/spine-cocos2dx.cpp

+ 2 - 0
spine-cocos2dx/src/spine/spine-cocos2dx.cpp

@@ -35,12 +35,14 @@ USING_NS_CC;
 
 
 void _spAtlasPage_createTexture (spAtlasPage* self, const char* path) {
 void _spAtlasPage_createTexture (spAtlasPage* self, const char* path) {
 	Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(path);
 	Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(path);
+	texture->retain();
 	self->rendererObject = texture;
 	self->rendererObject = texture;
 	self->width = texture->getPixelsWide();
 	self->width = texture->getPixelsWide();
 	self->height = texture->getPixelsHigh();
 	self->height = texture->getPixelsHigh();
 }
 }
 
 
 void _spAtlasPage_disposeTexture (spAtlasPage* self) {
 void _spAtlasPage_disposeTexture (spAtlasPage* self) {
+	((Texture2D*)self->rendererObject)->release();
 }
 }
 
 
 char* _spUtil_readFile (const char* path, int* length) {
 char* _spUtil_readFile (const char* path, int* length) {