1. Meng Jie
  2. love

Commits

Bart van Strien  committed 02147fe

Thread wrapper checks for failed thread creation. (fixes #90)

  • Participants
  • Parent commits 32bf598
  • Branches default

Comments (0)

Files changed (1)

File src/modules/thread/sdl/wrap_Thread.cpp

View file
 		else
 			data = luax_checktype<love::Data>(L, 2, "Data", DATA_T);
 		Thread *t = instance->newThread(name, data);
+		if (!t)
+			return luaL_error(L, "A thread with that name already exists.");
 		luax_newtype(L, "Thread", THREAD_THREAD_T, (void*)t);
 		return 1;
 	}