Skip to content

Commit

Permalink
Merge pull request #122 from Entropy-Foundation/so-schen-patch-1
Browse files Browse the repository at this point in the history
Update registry cache
  • Loading branch information
so-schen authored Nov 10, 2024
2 parents 907c759 + 7d98dec commit 6645242
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions types/src/state_store/state_key/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,13 @@ where
fn maybe_remove(&self, key1: &Key1, key2: &Key2) {
let mut locked = self.inner.write();
if let Some(map2) = locked.get_mut(key1) {
map2.remove(key2);
if map2.is_empty() {
locked.remove(key1);
if let Some(entry) = map2.get(key2) {
if entry.strong_count() == 0 {
map2.remove(key2);
if map2.is_empty() {
locked.remove(key1);
}
}
}
}
}
Expand Down

0 comments on commit 6645242

Please sign in to comment.