Projects > cpp > Issues > Bug #215

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

usage of for loop error in CCTexture2d.cpp

Bug #215 [Closed]
zhangxm 2010-11-22 02:00 . Updated over 4 years ago

The error code is marked underline:

void CCTextureCache::removeUnusedTextures()
{
std::vectorstd::string keys = m_pTextures~~>allKeys;
std::vectorstd::string::iterator it;
for ; it <= keys.end; it**)
{
CCTexture2D *value = m_pTextures~~>objectForKey(*it);
if (value~~>retainCount == 1)
{
CCLOG ("cocos2d: CCTextureCache: removing unused texture: %s", (*it).c_str);
m_pTextures~~>removeObjectForKey(*it);
}
}
}

Anonymous 2010-11-22 05:02
  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset commit:ā€œ7b83082b7f00b4e0e2e6ffffcb61536e1c3ba69eā€.

zhangxm 2010-11-22 17:52
  • Status changed from Resolved to Closed

The bug is fixed. The code is:

void CCTextureCache::removeUnusedTextures() {
std::vectorstd::string keys = m_pTextures~~>allKeys;
std::vectorstd::string::iterator it;
for ; it != keys.end; it**) {
CCTexture2D *value = m_pTextures~~>objectForKey(*it);
if (value~~>retainCount == 1) {
CCLOG.c_str);
m_pTextures~~>removeObjectForKey(*it);
}
}
}

walzer@cocos2d-x.org 2011-01-27 18:29
  • Project changed from 7 to cocos2d-x
walzer@cocos2d-x.org 2011-01-27 18:32
  • Category set to 1
walzer@cocos2d-x.org 2012-05-25 08:29
  • Project changed from cocos2d-x to cpp
  • Category deleted (1)
  • Target version deleted (cocos2d-0.99.4-x-0.7.0)

Atom PDF

Status:Closed
Start date:2010-11-22
Priority:Normal
Due date:
Assignee:zhangxm
% Done:

100%

Category:-
Target version:-
Estimated time:1.00 point

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.