Changeset 1206

Show
Ignore:
Timestamp:
03/05/2010 03:27:45 PM (6 months ago)
Author:
Paroxysm
Message:

This might fix that idle crash.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Trunk/src/LuaEngine/LUAEngine.cpp

    r1205 r1206  
    249249        int top = lua_gettop(lu); 
    250250        if(strcmp(luaL_typename(lu,top-params),"function") ) 
     251        { 
    251252                ret = false; 
     253                //Paroxysm : Stack Cleaning here, not sure what causes that crash in luaH_getstr, maybe due to lack of stack space. Anyway, experimental. 
     254                if(params > 0) 
     255                { 
     256                        for(int i = top; i >= (top-params); i--) 
     257                        { 
     258                                if(!lua_isnone(lu,i) ) 
     259                                        lua_remove(lu,i); 
     260                        } 
     261                } 
     262        } 
    252263        else 
    253264        {