summaryrefslogtreecommitdiff
path: root/ext/web/stream_resource.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/web/stream_resource.rs')
-rw-r--r--ext/web/stream_resource.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/web/stream_resource.rs b/ext/web/stream_resource.rs
index 54ebf775a..78487883b 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!(