Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6763


Ignore:
Timestamp:
Apr 19, 2010, 6:09:10 PM (14 years ago)
Author:
rgrieder
Message:

Using our own error handler (including the debugger) for Lua code executed through CEGUILuaFunctor.

Location:
code/trunk/src/libraries/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/GUIManager.cc

    r6749 r6763  
    133133        luaState_->setDefaultResourceInfo(this->rootFileInfo_);
    134134        scriptModule_.reset(new LuaScriptModule(luaState_->getInternalLuaState()));
     135        scriptModule_->setDefaultPCallErrorHandler(LuaState::ERROR_HANDLER_NAME);
    135136
    136137        // Create our own logger to specify the filepath
  • code/trunk/src/libraries/core/LuaState.cc

    r6746 r6763  
    4747    LuaState::ToluaInterfaceMap LuaState::toluaInterfaces_s;
    4848    std::vector<LuaState*> LuaState::instances_s;
     49
     50    const std::string LuaState::ERROR_HANDLER_NAME = "errorHandler";
    4951
    5052    // Do this after declaring toluaInterfaces_s and instances_s to avoid larger problems
     
    177179
    178180        // Push custom error handler that uses the debugger
    179         lua_getglobal(this->luaState_, "errorHandler");
     181        lua_getglobal(this->luaState_, ERROR_HANDLER_NAME.c_str());
    180182        int errorHandler = lua_gettop(luaState_);
    181183        if (lua_isnil(this->luaState_, -1))
  • code/trunk/src/libraries/core/LuaState.h

    r6746 r6763  
    100100        static void closeToluaInterfaces(lua_State* state);
    101101
     102        static const std::string ERROR_HANDLER_NAME;
     103
    102104    private:
    103105        shared_ptr<ResourceInfo> getFileInfo(const std::string& filename);
Note: See TracChangeset for help on using the changeset viewer.