Does adding items to Debris automatically disconnect any events associated with them?

Title is pretty self explanatory, however to further explain my situation, while researching methods on how to clear up lag in your game, I stumbled upon some posts regarding memory leaks due to events and the methods on how to clean them up, presumably using the :Disconnect() function, I also remember someone mentioning that using the Destroy() function automatically clears up these memory leaks as well. So does adding objects to Debris automatically disconnect any events?

Please let me know if this information is actually correct as I do use the Destroy() function and the Debris service quite often.

Also, do these rules apply to RemoteEvents as well?

Thanks.

The Debris service will call destroy on the instance if it still exists after the set time has elapsed, so yes all connections will be disconnected, you can read more on the API here: Debris | Documentation - Roblox Creator Hub, Also, yes it applies to remote instances as well.

1 Like