Skip to content

Commit 858bec2

Browse files
Kumpelinusmat-1
andauthored
Fix deadlock when changing server (#200)
* Fix deadlock when changing server * remove unnecessary clones --------- Co-authored-by: mat <git@matdoes.dev>
1 parent 8d110a9 commit 858bec2

File tree

1 file changed

+3
-6
lines changed
  • azalea-client/src/packet_handling

1 file changed

+3
-6
lines changed

azalea-client/src/packet_handling/game.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,11 @@ pub fn process_packet_events(ecs: &mut World) {
286286
Some(player_entity),
287287
);
288288
{
289+
let map = instance_holder.instance.read().registries.map.clone();
289290
let new_registries = &mut weak_instance.write().registries;
290291
// add the registries from this instance to the weak instance
291-
for (registry_name, registry) in
292-
&instance_holder.instance.read().registries.map
293-
{
294-
new_registries
295-
.map
296-
.insert(registry_name.clone(), registry.clone());
292+
for (registry_name, registry) in map {
293+
new_registries.map.insert(registry_name, registry);
297294
}
298295
}
299296
instance_holder.instance = weak_instance;

0 commit comments

Comments
 (0)