Are channels closed by garbage collector? #1379
-
I don't know whether garbage collector closes channels. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
When a channel gets garbage-collected, it calls the deinit function. These aren't exactly the same, Whether this makes any difference is a question for your code. If you want to make it such that the answer is an unambiguous "yes", just add a constructed call of cfun_channel_close to the gc function before deinitializing. |
Beta Was this translation helpful? Give feedback.
I think the current codebase does the right thing.