Fixed epic bug in runtime.cpp causing non-Lua-owned objects to be released by Lua GC.

This commit is contained in:
rude
2009-09-05 16:14:52 +02:00
parent fea48f421c
commit 3c2bd1bd9c
12 changed files with 1038 additions and 10 deletions
+4 -3
View File
@@ -37,9 +37,10 @@ namespace love
**/
static int w__gc(lua_State * L)
{
Proxy * u = (Proxy *)lua_touserdata(L, 1);
Object * t = (Object *)u->data;
t->release();
Proxy * p = (Proxy *)lua_touserdata(L, 1);
Object * t = (Object *)p->data;
if(p->own)
t->release();
return 0;
}