document potential memory leak in unbounded channel
This commit is contained in:
parent
d3d145ea1c
commit
9c6a0766be
@ -547,6 +547,9 @@ fn discard_all_messages(&self) {
|
||||
}
|
||||
|
||||
let mut head = self.head.index.load(Ordering::Acquire);
|
||||
// the channel may be uninitialized, so we have to swap to avoid overwriting any sender's attempts
|
||||
// to initalize the first block before noticing that the receivers disconnected. late allocations
|
||||
// will be deallocated by the sender in Drop
|
||||
let mut block = self.head.block.swap(ptr::null_mut(), Ordering::AcqRel);
|
||||
|
||||
// If we're going to be dropping messages we need to synchronize with initialization
|
||||
|
Loading…
Reference in New Issue
Block a user