Thread:start now clears the thread's error string before starting

This commit is contained in:
Alex Szpakowski
2013-08-03 05:00:46 -03:00
parent 2128ba321e
commit 4dba3e91e2
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -52,6 +52,7 @@ LuaThread::~LuaThread()
void LuaThread::threadFunction()
{
this->retain();
error.clear();
lua_State *L = luaL_newstate();
luaL_openlibs(L);
#ifdef LOVE_BUILD_STANDALONE
+1 -1
View File
@@ -58,7 +58,7 @@ int w_Thread_getError(lua_State *L)
{
LuaThread *t = luax_checkthread(L, 1);
std::string err = t->getError();
if (err.length() == 0)
if (err.empty())
lua_pushnil(L);
else
luax_pushstring(L, err);