When a ModuleScript is destroyed, the events it creates do not get disconnected, this has significant performance implications, especially when developing plugins, as plugins can be reloaded multiple times in one session, creating a memory cost every time we reload it.
Below is a repro of this happening with a plugin, if you reload and resize the baseplate, you’ll notice the prints increase for every time the plugin is reloaded.
Repro.rbxm (1.6 KB)
![]()
Expected behavior
When a ModuleScript is destroyed, it should disconnect any events that were created from within the ModuleScript, similar to how it does with scripts.