mirror of https://github.com/axmolengine/axmol.git
fixed #1224: Memory leak in CCParticleSystem::initWithDictionary()
This commit is contained in:
parent
4353b07aed
commit
d998b54269
|
@ -315,6 +315,8 @@ bool CCParticleSystem::initWithDictionary(CCDictionary *dictionary)
|
||||||
CC_BREAK_IF(!isOK);
|
CC_BREAK_IF(!isOK);
|
||||||
|
|
||||||
setTexture(CCTextureCache::sharedTextureCache()->addUIImage(image, fullpath.c_str()));
|
setTexture(CCTextureCache::sharedTextureCache()->addUIImage(image, fullpath.c_str()));
|
||||||
|
|
||||||
|
image->release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CCAssert( this->m_pTexture != NULL, "CCParticleSystem: error loading the texture");
|
CCAssert( this->m_pTexture != NULL, "CCParticleSystem: error loading the texture");
|
||||||
|
|
|
@ -25,11 +25,11 @@ THE SOFTWARE.
|
||||||
#ifndef __CC_IMAGE_H__
|
#ifndef __CC_IMAGE_H__
|
||||||
#define __CC_IMAGE_H__
|
#define __CC_IMAGE_H__
|
||||||
|
|
||||||
#include "CCCommon.h"
|
#include "CCObject.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
class CC_DLL CCImage
|
class CC_DLL CCImage : public CCObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CCImage();
|
CCImage();
|
||||||
|
|
|
@ -679,7 +679,7 @@ VolatileTexture::VolatileTexture(CCTexture2D *t)
|
||||||
VolatileTexture::~VolatileTexture()
|
VolatileTexture::~VolatileTexture()
|
||||||
{
|
{
|
||||||
textures.remove(this);
|
textures.remove(this);
|
||||||
CC_SAFE_FREE(uiImage);
|
CC_SAFE_RELEASE(uiImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VolatileTexture::addImageTexture(CCTexture2D *tt, const char* imageFileName, CCImage::EImageFormat format)
|
void VolatileTexture::addImageTexture(CCTexture2D *tt, const char* imageFileName, CCImage::EImageFormat format)
|
||||||
|
@ -700,7 +700,7 @@ void VolatileTexture::addImageTexture(CCTexture2D *tt, const char* imageFileName
|
||||||
void VolatileTexture::addCCImage(CCTexture2D *tt, CCImage *image)
|
void VolatileTexture::addCCImage(CCTexture2D *tt, CCImage *image)
|
||||||
{
|
{
|
||||||
VolatileTexture *vt = findVolotileTexture(tt);
|
VolatileTexture *vt = findVolotileTexture(tt);
|
||||||
|
image->retain();
|
||||||
vt->uiImage = image;
|
vt->uiImage = image;
|
||||||
vt->m_eCashedImageType = kImage;
|
vt->m_eCashedImageType = kImage;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue