Projects > cpp > Issues > Bug #2221

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

Create Issue on Github

CCCallback function may cause crash on win32

Bug #2221 [Rejected]
zhangxm 2013-05-24 09:30 . Updated about 9 years ago

demo

void MyClass::callback1()
{
    ....

    CCDelayTime* delay = CCDelayTime:create(1.0f);
    CCCallFunc* call = CCCallFunc::create(this, callfunc_selector(MyClass::callback2));
    runAction(CCSequence::create(delay, call, NULL));
}

void MyClass::callback2()
{
    ....
}

void MyClass::tets()
{
    runAction(CCCallFunc::create(this, callfunc_selector(MyClass::callback1));
}

Error log:

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

I haven’t tested it.

zhangxm 2013-05-24 09:30
  • Description updated (diff)
zhangxm 2013-06-10 14:40
  • Target version changed from 2.1.4 to 3.0-alpha0-pre
zhangxm 2013-07-27 11:45
  • Target version changed from 3.0-alpha0-pre to 3.0-alpha0
boyu0 2013-08-23 08:12
  • Assignee set to boyu0
boyu0 2013-08-29 06:12
  • Status changed from New to Rejected

I test it in win7, and the engine is newest from github.
In HelloCpp, I write code:

bool HelloWorld::init()
{
    ...
    runAction(CallFunc::create(this, callfunc_selector(HelloWorld::callback1)));
}
void HelloWorld::callback1()
{
    CCLOG("callback1");
    DelayTime* delay = DelayTime::create(2.0f);
    CallFunc* call = CCCallFunc::create(this, callfunc_selector(HelloWorld::callback2));
    runAction(CCSequence::create(delay, call, NULL));
}

void HelloWorld::callback2()
{
    CCLOG("callback2");
    DelayTime* delay = DelayTime::create(1.0f);
    CallFunc* call = CCCallFunc::create(this, callfunc_selector(HelloWorld::callback1));
    runAction(CCSequence::create(delay, call, NULL));
}

It seems OK, maybe it’s fixed somewhere.

agenindonesia 2014-11-25 20:33

Pokerstar88.com Agen Texas Poker Dan Domino Online Indonesia Terpercaya
OK, I’ve updated the announcement and added a link to zipball on google code. Thank you for reminding me.
Agen Indonesia | Agen Bola | Poker Indonesia

ionliga 2014-11-28 14:38

The optimization introduces a bug where the priority and Touch Mode will not get changed if the list is locked.
The most straight forward fix is to merge the pHandlersToAdd and pHandlersToRemove into a queue and process through all of them in the order they are received

Pokerstar88.com Agen Texas Poker dan Domino Online Indonesia Terpercaya | Agen Bola | Taruhan Bola | Agen Bola | Olb365.com Agen Judi Bola Online, Agen Judi Casino Online Indonesia Terpercaya

Atom PDF

Status:Rejected
Start date:2013-05-24
Priority:Normal
Due date:
Assignee:boyu0
% Done:

0%

Category:windows
Target version:3.0-alpha0