Game Development Community

useModifiers cause crash

by Danny · in Technical Issues · 03/08/2017 (6:15 pm) · 1 replies

none of "GuiBitmapButtonCtrl::useModifiers" is set to true in my project.
but the game would crash in the ninth line "onDefaultClick_callback();";

//code
void GuiBitmapButtonCtrl::onAction()
{
Parent::onAction();

if( mUseModifiers )
{
switch( getCurrentModifier() )
{
case ModifierNone:
onDefaultClick_callback(); // crash here!

break;

case ModifierCtrl:
onCtrlClick_callback();
break;

case ModifierAlt:
onAltClick_callback();
break;

case ModifierShift:
onShiftClick_callback();
break;

default:
break;
}
}
}


All of our teammates feel confused,we cant find any place to set "GuiBitmapButtonCtrl::useModifiers" true.
So we think it is impossible to crash here;
But The crash appears few times. we have tested more than one thousand times to click the button and the game crashes about ten times;


Be grateful for any replay!


About the author

Recent Threads


#1
03/09/2017 (6:59 pm)
If you're not setting useModifiers to true in any of GuiBitmapButtonCtrl profiles then it sounds like either call stack corruption or use-after-free problem. In either case, the problem lies elsewhere.