mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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 <lashwinib@gmail.com> * added the corrections Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
parent
12e6ec25aa
commit
324f42abd7
1 changed files with 1 additions and 1 deletions
|
@ -446,7 +446,7 @@ impl Response {
|
|||
|
||||
pub fn stream_chunk(&self, chunk: Vec<u8>, 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue