mirror of
https://github.com/LiteyukiStudio/magicoca.git
synced 2024-11-15 05:14:24 +08:00
🐛 在回收时关闭通道以节省资源
This commit is contained in:
parent
efa55473ff
commit
8a2f07fcf1
@ -110,3 +110,9 @@ class Chan(Generic[T]):
|
|||||||
Returns:
|
Returns:
|
||||||
"""
|
"""
|
||||||
self.recv_conn, other.recv_conn = other.recv_conn, self.recv_conn
|
self.recv_conn, other.recv_conn = other.recv_conn, self.recv_conn
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
"""
|
||||||
|
Close the channel when the object is deleted.
|
||||||
|
"""
|
||||||
|
self.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user