Browse Source

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

Alex Szpakowski 12 years ago
parent
commit
4dba3e91e2
2 changed files with 2 additions and 1 deletions
  1. 1 0
      src/modules/thread/LuaThread.cpp
  2. 1 1
      src/modules/thread/wrap_LuaThread.cpp

+ 1 - 0
src/modules/thread/LuaThread.cpp

@@ -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
src/modules/thread/wrap_LuaThread.cpp

@@ -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);