mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
Fix deadlock when changing server (#200)
* Fix deadlock when changing server * remove unnecessary clones --------- Co-authored-by: mat <git@matdoes.dev>
This commit is contained in:
parent
8d110a9f7c
commit
858bec2081
1 changed files with 3 additions and 6 deletions
|
@ -286,14 +286,11 @@ pub fn process_packet_events(ecs: &mut World) {
|
|||
Some(player_entity),
|
||||
);
|
||||
{
|
||||
let map = instance_holder.instance.read().registries.map.clone();
|
||||
let new_registries = &mut weak_instance.write().registries;
|
||||
// add the registries from this instance to the weak instance
|
||||
for (registry_name, registry) in
|
||||
&instance_holder.instance.read().registries.map
|
||||
{
|
||||
new_registries
|
||||
.map
|
||||
.insert(registry_name.clone(), registry.clone());
|
||||
for (registry_name, registry) in map {
|
||||
new_registries.map.insert(registry_name, registry);
|
||||
}
|
||||
}
|
||||
instance_holder.instance = weak_instance;
|
||||
|
|
Loading…
Add table
Reference in a new issue