mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Drop root_flow to avoid rule node leaks
This commit is contained in:
parent
87c51bd8bf
commit
c32c0ac9dc
1 changed files with 4 additions and 0 deletions
|
@ -793,6 +793,10 @@ impl LayoutThread {
|
||||||
/// Shuts down the layout thread now. If there are any DOM nodes left, layout will now (safely)
|
/// Shuts down the layout thread now. If there are any DOM nodes left, layout will now (safely)
|
||||||
/// crash.
|
/// crash.
|
||||||
fn exit_now(&mut self) {
|
fn exit_now(&mut self) {
|
||||||
|
// Drop the root flow explicitly to avoid holding style data, such as
|
||||||
|
// rule nodes. The `Stylist` checks when it is dropped that all rule
|
||||||
|
// nodes have been GCed, so we want drop anyone who holds them first.
|
||||||
|
self.root_flow.borrow_mut().take();
|
||||||
// Drop the rayon threadpool if present.
|
// Drop the rayon threadpool if present.
|
||||||
let _ = self.parallel_traversal.take();
|
let _ = self.parallel_traversal.take();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue