Logo with title ".Blog"

Maid pattern

Published on

Janitor/Maid/etc are different conveniences built on the same core principal: finalization is established near initialization. I continue to assert that maid is a pattern, so the best solution is to either roll your own, or pick whatever best suits your needs.

Here’s my implementation, which represents my current theory on the matter:

https://github.com/Anaminus/roblox-library/tree/master/modules/Maid

As for memory leaks, no library will save you from having the wrong mindset about memory management. Maids and Janitors are just one of the many possible answers to “What am I going to do about this thing I just created once I no longer need it?”