Fix an issue of not releasing Texture instance in ScrollViewBar

This commit is contained in:
Neo Kim 2015-07-06 11:29:39 +09:00
parent a4803c6713
commit 43308e258a
1 changed files with 8 additions and 5 deletions

View File

@ -48,14 +48,17 @@ static Sprite* createSpriteFromBase64(const char* base64String)
CCASSERT(imageResult, "Failed to create image from base64!");
free(decoded);
Texture2D *pTexture = new Texture2D();
pTexture->initWithImage(image);
pTexture->setAliasTexParameters();
Texture2D *texture = new Texture2D();
texture->initWithImage(image);
texture->setAliasTexParameters();
image->release();
return Sprite::createWithTexture(pTexture);
}
Sprite* sprite = Sprite::createWithTexture(texture);
texture->release();
return sprite;
}
ScrollViewBar::ScrollViewBar(ScrollView* parent, ScrollView::Direction direction):
_parent(parent),
_direction(direction),