mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 17:07:22 +01:00
fixes for when removing a pair or client
This commit is contained in:
parent
d7cad81eb0
commit
f68aa94dc3
2 changed files with 20 additions and 4 deletions
|
|
@ -87,7 +87,11 @@ public class PairManager : IDisposable
|
|||
|
||||
if (!_allClientPairs[item.Key].HasAnyConnection())
|
||||
{
|
||||
_allClientPairs.TryRemove(item.Key, out _);
|
||||
if (_allClientPairs.TryRemove(item.Key, out var pair))
|
||||
{
|
||||
pair.CachedPlayer?.Dispose();
|
||||
pair.CachedPlayer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
RecreateLazy();
|
||||
|
|
@ -197,6 +201,8 @@ public class PairManager : IDisposable
|
|||
|
||||
if (!pair.HasAnyConnection())
|
||||
{
|
||||
pair.CachedPlayer?.Dispose();
|
||||
pair.CachedPlayer = null;
|
||||
_allClientPairs.TryRemove(dto.User, out _);
|
||||
}
|
||||
|
||||
|
|
@ -211,6 +217,8 @@ public class PairManager : IDisposable
|
|||
pair.UserPair = null;
|
||||
if (!pair.HasAnyConnection())
|
||||
{
|
||||
pair.CachedPlayer?.Dispose();
|
||||
pair.CachedPlayer = null;
|
||||
_allClientPairs.TryRemove(dto.User, out _);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue