diff options
| author | Kumpelinus <kumpelinus@jat.de> | 2025-02-03 20:31:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-03 13:31:32 -0600 |
| commit | 858bec2081451a1926c2139c59bb7be8725b4d9a (patch) | |
| tree | bb3fa4d91f2d89d0690e32efc750571cbafae459 | |
| parent | 8d110a9f7c568fd52fc6c213d707206287311319 (diff) | |
| download | azalea-drasl-858bec2081451a1926c2139c59bb7be8725b4d9a.tar.xz | |
Fix deadlock when changing server (#200)
* Fix deadlock when changing server
* remove unnecessary clones
---------
Co-authored-by: mat <git@matdoes.dev>
| -rw-r--r-- | azalea-client/src/packet_handling/game.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index e61d401e..f8e72a4a 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -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; |
