cocos2d/cocos2d-x — pull request #4443 by samuele3hu (2013-12-06 07:53:50+00:00)
Title: issue #3353:Lua gc mechanism will make the extended attributes of lua userdata disappear

When we create a node child for a layer and extend some attributes value,we can do as follow:

local node = cc.Node:create()
node.extendValue1 = 10000
layerParent:addChild(node,0,9999)

When we wan to get this node and its extend attribute value somewhere, we can do as follow:

local child = layerParent:getChildByTag(9999)
print(child.extendValue1)

Sometimes we will get 10000,and sometimes we will get nil. Because the lua gc event collect the node value,so when we call getChildByTag,it create a new usedata and the extend attribute value is nil.