Răsfoiți Sursa

Merge pull request #1105 from bpbromberg/next

Fixed missing lua_pops after calls to lua_len
Sean Paul Taylor 12 ani în urmă
părinte
comite
730d7a07a5
2 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 1 0
      gameplay/src/ScriptController.cpp
  2. 1 0
      gameplay/src/ScriptController.inl

+ 1 - 0
gameplay/src/ScriptController.cpp

@@ -22,6 +22,7 @@
     /* Get the size of the array. */ \
     lua_len(sc->_lua, index); \
     int size = luaL_checkint(sc->_lua, -1); \
+    lua_pop(sc->_lua, 1); \
     if (size <= 0) \
         return LuaArray<type>((type*)NULL); \
     \

+ 1 - 0
gameplay/src/ScriptController.inl

@@ -121,6 +121,7 @@ ScriptUtil::LuaArray<T> ScriptUtil::getObjectPointer(int index, const char* type
         // Get the size of the array.
         lua_len(sc->_lua, index);
         int size = luaL_checkint(sc->_lua, -1);
+        lua_pop(sc->_lua, 1);
 
         if (size <= 0)
         {