Commits

Bart van Strien committed 6cccc07

Catch possible exceptions thrown when locking a SpriteBatch twice

Comments (0)

Files changed (1)

src/modules/graphics/opengl/wrap_SpriteBatch.cpp

 int w_SpriteBatch_bind(lua_State *L)
 {
 	SpriteBatch *t = luax_checkspritebatch(L, 1);
-	t->lock();
+	try
+	{
+		t->lock();
+	}
+	catch (love::Exception &e)
+	{
+		return luaL_error(L, "%s", e.what());
+	}
 	return 0;
 }