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:
Emilio Cobos Álvarez 2017-09-14 20:55:45 +02:00
parent cb31e782aa
commit 5be81d04a7
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 11 additions and 1 deletions

View file

@ -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