mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Missing retain() calls in get*List functions
--HG-- branch : box2d-update
This commit is contained in:
@@ -404,6 +404,7 @@ namespace box2d
|
||||
if (!f) break;
|
||||
Fixture * fixture = (Fixture *)Memoizer::find(f);
|
||||
if (!fixture) throw love::Exception("A fixture has escaped Memoizer!");
|
||||
fixture->retain();
|
||||
luax_newtype(L, "Fixture", PHYSICS_FIXTURE_T, (void*)fixture);
|
||||
lua_rawseti(L, -2, i);
|
||||
i++;
|
||||
|
||||
@@ -380,6 +380,7 @@ namespace box2d
|
||||
if (b == groundBody) continue;
|
||||
Body * body = (Body *)Memoizer::find(b);
|
||||
if (!body) throw love::Exception("A body has escaped Memoizer!");
|
||||
body->retain();
|
||||
luax_newtype(L, "Body", PHYSICS_BODY_T, (void*)body);
|
||||
lua_rawseti(L, -2, i);
|
||||
i++;
|
||||
@@ -396,6 +397,7 @@ namespace box2d
|
||||
if (!j) break;
|
||||
Joint * joint = (Joint *)Memoizer::find(j);
|
||||
if (!joint) throw love::Exception("A joint has escaped Memoizer!");
|
||||
joint->retain();
|
||||
luax_newtype(L, "Joint", PHYSICS_JOINT_T, (void*)joint);
|
||||
lua_rawseti(L, -2, i);
|
||||
i++;
|
||||
@@ -412,6 +414,7 @@ namespace box2d
|
||||
if (!c) break;
|
||||
Contact * contact = (Contact *)Memoizer::find(c);
|
||||
if (!contact) throw love::Exception("A contact has escaped Memoizer!");
|
||||
contact->retain();
|
||||
luax_newtype(L, "Contact", PHYSICS_CONTACT_T, (void*)contact);
|
||||
lua_rawseti(L, -2, i);
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user