From 324f42abd71bfe15acc3bf7e56bb8f7d7e4c0c20 Mon Sep 17 00:00:00 2001 From: chickenleaf Date: Wed, 23 Oct 2024 17:21:15 +0530 Subject: [PATCH] Use borrow() to fix GC hazard in stream_chunk (#33976) * Use borrow() to fix GC hazard in stream_chunk Signed-off-by: L Ashwin B * added the corrections Signed-off-by: L Ashwin B --------- Signed-off-by: L Ashwin B --- components/script/dom/response.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/script/dom/response.rs b/components/script/dom/response.rs index 1f82ba255ce..258247fb2d9 100644 --- a/components/script/dom/response.rs +++ b/components/script/dom/response.rs @@ -446,7 +446,7 @@ impl Response { pub fn stream_chunk(&self, chunk: Vec, can_gc: CanGc) { // Note, are these two actually mutually exclusive? - if let Some(stream_consumer) = self.stream_consumer.borrow_mut().as_ref() { + if let Some(stream_consumer) = self.stream_consumer.borrow().as_ref() { stream_consumer.consume_chunk(chunk.as_slice()); } else if let Some(body) = self.body_stream.get() { body.enqueue_native(chunk, can_gc);