Browse Source

Fixed love.graphics.newFont(filedata) causing crashes (resolves issue #1119).

Alex Szpakowski 9 years ago
parent
commit
9d6ff6e5de
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/modules/font/wrap_Font.cpp

+ 3 - 0
src/modules/font/wrap_Font.cpp

@@ -85,7 +85,10 @@ int w_newTrueTypeRasterizer(lua_State *L)
 		love::Data *d = nullptr;
 		love::Data *d = nullptr;
 
 
 		if (luax_istype(L, 1, DATA_ID))
 		if (luax_istype(L, 1, DATA_ID))
+		{
 			d = luax_checkdata(L, 1);
 			d = luax_checkdata(L, 1);
+			d->retain();
+		}
 		else
 		else
 			d = filesystem::luax_getfiledata(L, 1);
 			d = filesystem::luax_getfiledata(L, 1);