pg icon indicating copy to clipboard operation
pg copied to clipboard

avoid explicitly close all data channels to prevent panics

Open lwintermelon opened this issue 1 month ago • 0 comments

The solution is very simple and less intrusive.

Rule 1: Don't close all dataCh, let GC handle. Rule 2: Make sure when ctx.Done() is triggered, all senders and receivers will finish. So the GC is happy to release the channel.

To figure out all ownership probems of send on closed channel of the project is impossible, it requires a clear design when write the first line code.

will fix #38

lwintermelon avatar Nov 14 '25 09:11 lwintermelon