love.graphics.newImage, love.image.newImageData, etc. no longer leave Lua-owned FileData objects floating around waiting to be GC'd when called with filename arguments, resulting in less memory use on startup (resolves issue #890.)

Moved love.filesystem Lua wrapper code from src/modules/filesystem/physfs/ to src/modules/filesystem/.
This commit is contained in:
Alex Szpakowski
2014-06-02 00:22:41 -03:00
parent 4d0bbb97d8
commit 724bdbd296
17 changed files with 215 additions and 177 deletions
+4 -16
View File
@@ -232,22 +232,10 @@ int w_Shader_sendMatrix(lua_State *L)
lua_pop(L, 1 + dimension);
}
bool should_error = false;
try
{
shader->sendMatrix(name, dimension, values, count);
}
catch(love::Exception &e)
{
should_error = true;
lua_pushstring(L, e.what());
}
delete[] values;
if (should_error)
return luaL_error(L, "%s", lua_tostring(L, -1));
EXCEPT_GUARD_FINALLY(
{ shader->sendMatrix(name, dimension, values, count); },
{ delete[] values; }
)
return 0;
}