Solve the crash in CocoStudioComponentsTest.

This commit is contained in:
zhangbin 2014-03-06 09:23:27 +08:00
parent 4fe827e46b
commit 6da0afdd03
1 changed files with 2 additions and 0 deletions

View File

@ -122,10 +122,12 @@ void ComponentContainer::visit(float delta)
{
if (_components != nullptr)
{
CC_SAFE_RETAIN(_owner);
for (auto iter = _components->begin(); iter != _components->end(); ++iter)
{
iter->second->update(delta);
}
CC_SAFE_RELEASE(_owner);
}
}