Browse Source

lua: remove LuaLoader::Find() helper

This has proved unreliable because coroutines create whole new environments,
so one of the only ways to store user data and access it even from coroutines
is to use lua_setglobal().
legacy
Sam Hocevar 8 years ago
parent
commit
610d2a97ac
2 changed files with 0 additions and 10 deletions
  1. +0
    -9
      src/lolua/baselua.cpp
  2. +0
    -1
      src/lolua/baselua.h

+ 0
- 9
src/lolua/baselua.cpp View File

@@ -133,15 +133,6 @@ void Loader::Release(LuaState* l, Lolua::Loader* loader)
} }
} }


Lolua::Loader *LuaLoader::Find(LuaState* l)
{
for (int i = 0; i < g_loaders.count(); ++i)
if (g_loaders[i].m1 == l)
return g_loaders[i].m2;

return nullptr;
}

//Store lua object -------------------------------------------------------- //Store lua object --------------------------------------------------------
void Loader::StoreObject(LuaState* l, Object* obj) void Loader::StoreObject(LuaState* l, Object* obj)
{ {


+ 0
- 1
src/lolua/baselua.h View File

@@ -995,7 +995,6 @@ public:
protected: protected:
LuaState* GetLuaState(); LuaState* GetLuaState();
static void Store(LuaState* l, Loader* loader); static void Store(LuaState* l, Loader* loader);
static Loader *Find(LuaState* l);
static void Release(LuaState* l, Loader* loader); static void Release(LuaState* l, Loader* loader);
static void StoreObject(LuaState* l, Object* obj); static void StoreObject(LuaState* l, Object* obj);
//Virtual Store lua object ------------------------------------------------ //Virtual Store lua object ------------------------------------------------


Loading…
Cancel
Save