mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Clear the UA cache on shutdown.
MozReview-Commit-ID: KAGdhFb67hq Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
cb31e782aa
commit
5be81d04a7
2 changed files with 11 additions and 1 deletions
|
@ -131,6 +131,10 @@ impl UserAgentCascadeDataCache {
|
|||
fn expire_unused(&mut self) {
|
||||
self.entries.retain(|e| !e.is_unique())
|
||||
}
|
||||
|
||||
fn clear(&mut self) {
|
||||
self.entries.clear();
|
||||
}
|
||||
}
|
||||
|
||||
type PrecomputedPseudoElementDeclarations =
|
||||
|
@ -1502,6 +1506,11 @@ impl Stylist {
|
|||
|
||||
// We may measure other fields in the future if DMD says it's worth it.
|
||||
}
|
||||
|
||||
/// Shutdown the static data that this module stores.
|
||||
pub fn shutdown() {
|
||||
UA_CASCADE_DATA_CACHE.lock().unwrap().clear()
|
||||
}
|
||||
}
|
||||
|
||||
/// This struct holds data which users of Stylist may want to extract
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue