Various borrow hazard fixes (#33133)

* Reduce the scope of the document tag map borrow.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Reduce scope of borrow when finishing a Response.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Avoid creating a File object while borrowing FormData's data.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Prevent the GC from seeing an uninitialized window proxy slot.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2024-08-20 12:06:24 -04:00 committed by GitHub
parent c00cd1326a
commit bc5235827f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 12 deletions

View file

@ -466,7 +466,8 @@ impl Response {
if let Some(body) = self.body_stream.get() {
body.close_native();
}
if let Some(stream_consumer) = self.stream_consumer.borrow_mut().take() {
let stream_consumer = self.stream_consumer.borrow_mut().take();
if let Some(stream_consumer) = stream_consumer {
stream_consumer.stream_end();
}
}