mirror of https://github.com/axmolengine/axmol.git
Revert check for reference count, since it was correct. [skip ci]
This commit is contained in:
parent
188345e42a
commit
b420a33b68
|
@ -151,7 +151,7 @@ void SpriteFrameCache::removeUnusedSpriteFrames()
|
||||||
for (auto& iter : frames)
|
for (auto& iter : frames)
|
||||||
{
|
{
|
||||||
auto* spriteFrame = iter.second;
|
auto* spriteFrame = iter.second;
|
||||||
if (spriteFrame->getReferenceCount() <= 2) // A frame has a ref count of 1 when created, and 2 when added to cocos2d::Map. It is unused if the ref count is 2.
|
if (spriteFrame->getReferenceCount() == 1)
|
||||||
{
|
{
|
||||||
toRemoveFrames.push_back(iter.first);
|
toRemoveFrames.push_back(iter.first);
|
||||||
spriteFrame->getTexture()->removeSpriteFrameCapInset(spriteFrame);
|
spriteFrame->getTexture()->removeSpriteFrameCapInset(spriteFrame);
|
||||||
|
|
Loading…
Reference in New Issue