1 Commits

Author SHA1 Message Date
8a2f07fcf1 🐛 在回收时关闭通道以节省资源 2024-10-14 20:40:14 +08:00

View File

@@ -110,3 +110,9 @@ class Chan(Generic[T]):
Returns:
"""
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()