Destroyed physics objects don't immediately release Lua objects as expected
- Run the example program
- Press a key to create a physics world with 6MB of userdata
- Press a key again to destroy the world, collect garbage, and recreate the world
After recreating the world, there should be only one such world in memory, but Lua reports two worlds' worth of memory used. The old world's userdata was not collected.
Manually clearing the userdata avoids the issue. (In this example, doing more garbage collection also helps, but that may not be enough for a major project.)