If you save to signal to an object but destroy the object, does the signal still get GC’d?
For example;
local signal = obj.AncestryChanged:connect(function(child, parent)
end)
--some time later
obj:Destroy()
If you save to signal to an object but destroy the object, does the signal still get GC’d?
For example;
local signal = obj.AncestryChanged:connect(function(child, parent)
end)
--some time later
obj:Destroy()
The connection does get disconnected. But you still have a reference to the connection object itself. However when the scope the local is declared in ends there won’t be any more references to the connection so it can get gc’d