Cleaned up some StrongRef-related code.

This commit is contained in:
Alex Szpakowski
2016-03-01 18:57:17 -04:00
parent 8d7481c3b2
commit f51bbb8462
13 changed files with 52 additions and 53 deletions
+2 -3
View File
@@ -108,13 +108,13 @@ int w_File_isOpen(lua_State *L)
int w_File_read(lua_State *L)
{
File *file = luax_checkfile(L, 1);
Data *d = 0;
StrongRef<Data> d = nullptr;
int64 size = (int64) luaL_optnumber(L, 2, (lua_Number) File::ALL);
try
{
d = file->read(size);
d.set(file->read(size), Acquire::NORETAIN);
}
catch (love::Exception &e)
{
@@ -123,7 +123,6 @@ int w_File_read(lua_State *L)
lua_pushlstring(L, (const char *) d->getData(), d->getSize());
lua_pushnumber(L, d->getSize());
d->release();
return 2;
}