fullstorydev / grpchan

Channels for gRPC: custom transports
MIT License
204 stars 23 forks source link

fix issue with finalizer #50

Closed jhump closed 3 years ago

jhump commented 3 years ago

A finalizer was being set, but it was basically a no-op since the value in question would be pinned to the heap by a goroutine.

This fixes it so that the finalizer is set on a value that only the caller sees. So if the caller abandons the value without completing the RPC, the finalizer can be correctly run.