cocos2dx里面的两个BUG

1. Transition.cpp中setValue的BUG TransitionValue& value = item->startValue;
使用引用进行value的初始化,后面无法改变引用,导致总是修改的startValue,不会修改value与endValue
2. UIPackage的BUG
空图片,与空MovieClip的时候,
使用了SpriteFrame::createWithTexture
而有图片的时候使用了
//not using createWithTexture for saving a autorelease call.
UIPackage::createSpriteTexture
 
空图片的时候,已经调用了autorelease,后面还会调用release,导致引用计数错误。

4 个评论

1、为什么说后面无法改变引用?可以改变啊。
2、这个确实,我改改。
引用只能被初始化一次。如:
int a = 1, b= 2;
int& c = a; // 初始化引用
c = b; // 试图改变引用的对象
c = 3;
最后,a = 3, b = 2
在Transition.cpp中
TransitionValue& value = item->startValue; // 初始化引用
if (item->label == label)
{
if (item->tween)
value = item->startValue;
else
value = item->value; // 试图改变引用的对象,startValue的值被修改为了value的值
}
else if (item->label2 == label)
{
value = item->endValue; // 试图改变引用的对象,startValue的值被修改为了endValue的值
}
最后结果,value仍然是startValue的引用。
确实是,犯了个低级错误。改好提交到仓库了。谢谢指正。

要回复文章请先登录注册