1
2
Fork 0
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:
Kumpelinus 2025-02-03 20:31:32 +01:00 committed by GitHub
parent 8d110a9f7c
commit 858bec2081
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;