diff --git a/ext/web/stream_resource.rs b/ext/web/stream_resource.rs index 54ebf775ac..78487883b6 100644 --- a/ext/web/stream_resource.rs +++ b/ext/web/stream_resource.rs @@ -66,6 +66,13 @@ impl Default for BoundedBufferChannelInner { } } +impl Drop for BoundedBufferChannelInner { + fn drop(&mut self) { + // If any buffers remain in the ring, drop them here + self.drain(std::mem::drop); + } +} + impl std::fmt::Debug for BoundedBufferChannelInner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_fmt(format_args!(