Skip to content

Commit e060226

Browse files
authored
Update Signal.lua
1 parent 7e80394 commit e060226

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ReplicatedStorage/Signal.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,17 @@ function Signal:Fire(...)
274274
end
275275

276276
function Signal:DisconnectAll()
277+
self._firing += 1 --\\ Tag it as firing, we need _next in this case.
278+
277279
local connection = self._head
278-
local nextConnection = connection._next
279280
while connection ~= nil do
280-
nextConnection = connection._next
281281
connection:Disconnect()
282-
connection = nextConnection
282+
283+
connection = connection._next
283284
end
284285
self._head = nil
286+
287+
t_defer(CleanDisconnections, self)
285288
end
286289

287290
function Signal:Destroy()

0 commit comments

Comments
 (0)