Merge pull request #50 from TriAnMan/fix-memory-leak
Fix a memory leak when the connection is dropped by the client side
This commit is contained in:
commit
c218c4f5a8
@ -153,6 +153,12 @@ return function (port)
|
||||
|
||||
connection:on("receive", onReceive)
|
||||
connection:on("sent", onSent)
|
||||
connection:on("disconnection",function(c)
|
||||
if connectionThread then
|
||||
connectionThread = nil
|
||||
collectgarbage()
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user