Merge pull request #4295 from samuele3hu/developCCS

[ci skip]hot fix:Repair the crash of cocostudio and the bug of some lua test samples can't come in
This commit is contained in:
minggo 2013-11-17 23:10:01 -08:00
commit 946fd16adc
3 changed files with 13 additions and 9 deletions

View File

@ -622,9 +622,9 @@ Object* CCBAnimationManager::actionForCallbackChannel(CCBSequenceProperty* chann
Array *actions = Array::create();
Array *keyframes = channel->getKeyframes();
int numKeyframes = keyframes->count();
long numKeyframes = keyframes->count();
for (int i = 0; i < numKeyframes; ++i)
for (long i = 0; i < numKeyframes; ++i)
{
CCBKeyframe *keyframe = (CCBKeyframe*)keyframes->getObjectAtIndex(i);
@ -640,10 +640,14 @@ Object* CCBAnimationManager::actionForCallbackChannel(CCBSequenceProperty* chann
if(_jsControlled) {
String* callbackName = String::createWithFormat("%d:%s", selectorTarget, selectorName.c_str());
CallFunc *callback = ((CallFunc*)(_keyframeCallFuncs->objectForKey(callbackName->getCString())))->clone();
if(callback != NULL) {
actions->addObject(callback);
Object* callback = _keyframeCallFuncs->objectForKey(callbackName->getCString());
if (nullptr != callback)
{
CallFunc *callbackClone = (static_cast<CallFunc*>(callback))->clone();
if(callbackClone != NULL) {
actions->addObject(callbackClone);
}
}
}
else

View File

@ -1203,7 +1203,7 @@ void array_to_luaval(lua_State* L,Array* inValue)
if (nullptr == obj)
continue;
uint32_t typeId = typeid(*obj).hash_code();
long typeId = typeid(*obj).hash_code();
auto iter = g_luaType.find(typeId);
if (g_luaType.end() != iter)
{
@ -1292,7 +1292,7 @@ void dictionary_to_luaval(lua_State* L, Dictionary* dict)
if (NULL == element)
continue;
uint32_t typeId = typeid(element->getObject()).hash_code();
long typeId = typeid(element->getObject()).hash_code();
auto iter = g_luaType.find(typeId);
if (g_luaType.end() != iter)

View File

@ -691,7 +691,7 @@ int register_cocos2dx_extension_CCBProxy(lua_State* tolua_S)
tolua_endmodule(tolua_S);
tolua_endmodule(tolua_S);
uint32_t typeId = typeid(CCBProxy).hash_code();
long typeId = typeid(CCBProxy).hash_code();
g_luaType[typeId] = "CCBProxy";
return 1;
}