Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6761


Ignore:
Timestamp:
Apr 19, 2010, 4:49:11 PM (15 years ago)
Author:
rgrieder
Message:

Fixed "error in error handler" problem that occurred within CEGUILua scripted events (like clicking on a button).
Initialising values is always a good idea…
Also fixed a potential bug: not removing the error handler from the Lua stack can be very dangerous as I had to find out lately..

Location:
code/trunk/src/external/ceguilua/ceguilua-0.6.2/ceguilua
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/external/ceguilua/ceguilua-0.6.2/ceguilua/CEGUILua.cpp

    r5781 r6761  
    5656*************************************************************************/
    5757LuaScriptModule::LuaScriptModule() :
    58     d_errFuncIndex(LUA_NOREF)
     58    d_errFuncIndex(LUA_NOREF),
     59    d_activeErrFuncIndex(LUA_NOREF)
    5960{
    6061    #if LUA_VERSION_NUM >= 501
     
    105106        Constructor (uses given Lua state)
    106107*************************************************************************/
    107 LuaScriptModule::LuaScriptModule(lua_State* state)
     108LuaScriptModule::LuaScriptModule(lua_State* state) :
     109    d_errFuncIndex(LUA_NOREF),
     110    d_activeErrFuncIndex(LUA_NOREF)
    108111{
    109112        // just use the given state
  • code/trunk/src/external/ceguilua/ceguilua-0.6.2/ceguilua/CEGUILuaFunctor.cpp

    r5781 r6761  
    200200    lua_pop(L, 1);
    201201
     202    // remove error handler from stack
     203    if (err_idx != 0)
     204        lua_remove(L, err_idx);
     205
    202206        if(helper)
    203207        {
Note: See TracChangeset for help on using the changeset viewer.