Do you have to make a connection nil after disconnecting it?

Do you have to make a connection nil after disconnecting it?

Connection:Disconnect()
Connection = nil

No. You don’t have to, but you can if you want.

It has to be done, it is stored after disconnecting it
image
you can even disconnect again and it is considered true in if.

Yes, since the variable will still point towards the event which was connected to some function, only the function has now been disconnected. So you should nil the variable in order to avoid memory leaks.

3 Likes

What other things attribute to memory leak? My game seems to have some even though i’ve done this.