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);
|
||||
|
||||
setTexture(CCTextureCache::sharedTextureCache()->addUIImage(image, fullpath.c_str()));
|
||||
|
||||
image->release();
|
||||
}
|
||||
}
|
||||
CCAssert( this->m_pTexture != NULL, "CCParticleSystem: error loading the texture");
|
||||
|
|
|
@ -25,11 +25,11 @@ THE SOFTWARE.
|
|||
#ifndef __CC_IMAGE_H__
|
||||
#define __CC_IMAGE_H__
|
||||
|
||||
#include "CCCommon.h"
|
||||
#include "CCObject.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
class CC_DLL CCImage
|
||||
class CC_DLL CCImage : public CCObject
|
||||
{
|
||||
public:
|
||||
CCImage();
|
||||
|
|
|
@ -679,7 +679,7 @@ VolatileTexture::VolatileTexture(CCTexture2D *t)
|
|||
VolatileTexture::~VolatileTexture()
|
||||
{
|
||||
textures.remove(this);
|
||||
CC_SAFE_FREE(uiImage);
|
||||
CC_SAFE_RELEASE(uiImage);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
VolatileTexture *vt = findVolotileTexture(tt);
|
||||
|
||||
image->retain();
|
||||
vt->uiImage = image;
|
||||
vt->m_eCashedImageType = kImage;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue