mirror of https://github.com/axmolengine/axmol.git
Merge pull request #2261 from flaming0/gles20
Null pointer check in order to prevent crashes.
This commit is contained in:
commit
b9de14c8c7
|
@ -159,6 +159,8 @@ int CCLuaEngine::executeSchedule(int nHandler, float dt, CCNode* pNode/* = NULL*
|
|||
int CCLuaEngine::executeLayerTouchEvent(CCLayer* pLayer, int eventType, CCTouch *pTouch)
|
||||
{
|
||||
CCTouchScriptHandlerEntry* pScriptHandlerEntry = pLayer->getScriptTouchHandlerEntry();
|
||||
if (!pScriptHandlerEntry)
|
||||
return 0;
|
||||
int nHandler = pScriptHandlerEntry->getHandler();
|
||||
if (!nHandler) return 0;
|
||||
|
||||
|
@ -193,6 +195,8 @@ int CCLuaEngine::executeLayerTouchEvent(CCLayer* pLayer, int eventType, CCTouch
|
|||
int CCLuaEngine::executeLayerTouchesEvent(CCLayer* pLayer, int eventType, CCSet *pTouches)
|
||||
{
|
||||
CCTouchScriptHandlerEntry* pScriptHandlerEntry = pLayer->getScriptTouchHandlerEntry();
|
||||
if (!pScriptHandlerEntry)
|
||||
return 0;
|
||||
int nHandler = pScriptHandlerEntry->getHandler();
|
||||
if (!nHandler) return 0;
|
||||
|
||||
|
@ -237,6 +241,8 @@ int CCLuaEngine::executeLayerTouchesEvent(CCLayer* pLayer, int eventType, CCSet
|
|||
int CCLuaEngine::executeLayerKeypadEvent(CCLayer* pLayer, int eventType)
|
||||
{
|
||||
CCScriptHandlerEntry* pScriptHandlerEntry = pLayer->getScriptKeypadHandlerEntry();
|
||||
if (!pScriptHandlerEntry)
|
||||
return 0;
|
||||
int nHandler = pScriptHandlerEntry->getHandler();
|
||||
if (!nHandler) return 0;
|
||||
|
||||
|
@ -259,6 +265,8 @@ int CCLuaEngine::executeLayerKeypadEvent(CCLayer* pLayer, int eventType)
|
|||
int CCLuaEngine::executeAccelerometerEvent(CCLayer* pLayer, CCAcceleration* pAccelerationValue)
|
||||
{
|
||||
CCScriptHandlerEntry* pScriptHandlerEntry = pLayer->getScriptAccelerateHandlerEntry();
|
||||
if (!pScriptHandlerEntry)
|
||||
return 0;
|
||||
int nHandler = pScriptHandlerEntry->getHandler();
|
||||
if (!nHandler) return 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue