Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrectly deleted resources in clear_namespace function. #1524

Merged
merged 1 commit into from Jul 26, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -810,15 +810,15 @@ impl ResourceCache {
pub fn clear_namespace(&mut self, namespace: IdNamespace) {
//TODO: use `retain` when we are on Rust-1.18
let image_keys: Vec<_> = self.resources.image_templates.images.keys()
.filter(|&key| key.0 != namespace)
.filter(|&key| key.0 == namespace)
.cloned()
.collect();
for key in &image_keys {
self.resources.image_templates.images.remove(key);
}

let font_keys: Vec<_> = self.resources.font_templates.keys()
.filter(|&key| key.0 != namespace)
.filter(|&key| key.0 == namespace)
.cloned()
.collect();
for key in &font_keys {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.