mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
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:
@@ -489,6 +489,20 @@ Type luax_type(lua_State *L, int idx);
|
||||
return luaL_error(L, "%s", lua_tostring(L, -1)); \
|
||||
}
|
||||
|
||||
#define EXCEPT_GUARD_FINALLY(A, B) \
|
||||
{ \
|
||||
bool should_error = false; \
|
||||
try { A } \
|
||||
catch (love::Exception &e) \
|
||||
{ \
|
||||
should_error = true; \
|
||||
lua_pushstring(L, e.what()); \
|
||||
} \
|
||||
{ B } \
|
||||
if (should_error) \
|
||||
return luaL_error(L, "%s", lua_tostring(L, -1)); \
|
||||
}
|
||||
|
||||
} // love
|
||||
|
||||
#endif // LOVE_RUNTIME_H
|
||||
|
||||
Reference in New Issue
Block a user