mirror of
https://github.com/love2d/love.git
synced 2026-08-13 17:10:54 +02:00
ec9dec6b80
luax_pushtype keeps the object in a weak table and checks the table before creating a new userdata, so it re-uses the object's existing wrapper userdata if it can, whenever the object is pushed to Lua. This fixes some subtle issues with love objects, where using them as keys in tables would not always work as expected (https://love2d.org/forums/viewtopic.php?f=4&t=39398&p=112388#p112415). It also decreases the amount of new Lua objects created, saving the garbage collector some work.