I'm making a GUI that lists all of the items in a table of strings.
Each item in the table is represented by a TextBox
with a TextButton
inside of it.
Whenever an item's TextButton
is clicked, the item is removed from the list, which is then repopulated. The button's event listener is then disconnected.
Repopulating the list entails destroying all of the TextBox
es with ClearAllChildren()
, and then creating the list anew.
ROBLOX Wiki states, > "A connection is automatically disconnected if: ...The object the Event relates to is destroyed with the Destroy method."
It does not, however, mention the ClearAllChildren()
method, which could be problematic, considering that the objects that the event listener relates to are destroyed that way.
What I want to know is: Is an RBXScriptSignal
disconnected if its respective object is destroyed by ClearAllChildren()
?
The ClearAllChildren
function uses the deprecated remove
function. And, as you may know, the remove function simply sets the parent to nil; it does not disconnect connected events.