May a connection after script being destroyed/disabled still exists and cause memory leaks?

Hello. I would like to know if this one can cause memory leaks. I’ve tested it, and the connection still exists for some reason. I tried to disable/remove script, but nothing changed.

See below:

Is that because of bindable event, like i’ve linked it to that script i’m firing to? If yes, then how do i check in another way if connection was disconnected after script being removed/disabled?

1 Like

This is very weird behavior, because while the script prints that it’s connected, the function won’t run if the event is triggered(as it shouldn’t). It’s only after the event is triggered again that the Connected property updates to false.

1 Like

Oh, god. My game has some scripts with tons of connections. My game basically uses regeneration where scripts being restarted by disabling and enabling them. I thought they would be disconnected after script being removed/disabled. As for now, i should find a way to clear all connections in scripts before disabling/removing it.

i assume, roblox should do something with that, otherwise this can lead to memory leaks.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.