upvote
This actually is possible now. Contexts are now garbage-collectible, even if cancel() is not called.

In this case, the cancel() function was preventing the collection. But I think it can be changed to hold a weak reference instead. The overhead is too large to run it normally, but it should be OK for something like the race detector.

reply