mirror of https://github.com/axmolengine/axmol.git
Fix an issue of not releasing Texture instance in ScrollViewBar
This commit is contained in:
parent
a4803c6713
commit
43308e258a
|
@ -48,14 +48,17 @@ static Sprite* createSpriteFromBase64(const char* base64String)
|
||||||
CCASSERT(imageResult, "Failed to create image from base64!");
|
CCASSERT(imageResult, "Failed to create image from base64!");
|
||||||
free(decoded);
|
free(decoded);
|
||||||
|
|
||||||
Texture2D *pTexture = new Texture2D();
|
Texture2D *texture = new Texture2D();
|
||||||
pTexture->initWithImage(image);
|
texture->initWithImage(image);
|
||||||
pTexture->setAliasTexParameters();
|
texture->setAliasTexParameters();
|
||||||
image->release();
|
image->release();
|
||||||
|
|
||||||
return Sprite::createWithTexture(pTexture);
|
Sprite* sprite = Sprite::createWithTexture(texture);
|
||||||
}
|
texture->release();
|
||||||
|
|
||||||
|
return sprite;
|
||||||
|
}
|
||||||
|
|
||||||
ScrollViewBar::ScrollViewBar(ScrollView* parent, ScrollView::Direction direction):
|
ScrollViewBar::ScrollViewBar(ScrollView* parent, ScrollView::Direction direction):
|
||||||
_parent(parent),
|
_parent(parent),
|
||||||
_direction(direction),
|
_direction(direction),
|
||||||
|
|
Loading…
Reference in New Issue