Luau: enable __gc and collectgarbage

I should be allowed to lean on the luau garbage collector to trigger a cleanup function. This is useful with custom objects and other ephemeral data structures. I’d be significantly less prone to memory leaks if I could declare cleanup rules when I make the object rather than having to listen for some “no longer in use” trigger somewhere else in my codebase, then finding the object and cleaning it up.

9 Likes

This will almost certainly not happen.

image

image

Citing Sandboxing - Luau

7 Likes