jaipack17 / Nature2D

A 2D physics engine for Roblox. Create versatile physics simulations and mechanics with GUIs!
https://jaipack17.github.io/Nature2D/
MIT License
147 stars 8 forks source link

Improve Garbage Collection using Janitor #33

Closed jaipack17 closed 2 years ago

jaipack17 commented 2 years ago

As the library grows into a more concrete and highly composite one, there arrive a lot of issues with garbage cleaning and how we handle disconnecting events, destroying objects and instances. As of now, we just don't care about memory leaks! And yes, that is true. We are just hoping, that we don't run into such problems. And this hope dies down as we start using Nature2D for full fledged projects.

Problems that exist:

The library is prone to have memory leaks, but this pull request aims to solve all problems related to memory leaks and garbage cleaning using Janitor. This PR will remain a draft until all changes have been proposed and revised.

jaipack17 commented 2 years ago

Started working this!

howmanysmall commented 2 years ago

good job using the explicit cleanup method, that's always what i recommend because it results in less assuming