adds some locks to stop threading issues

This commit is contained in:
Madpeterz 2020-12-26 13:38:31 +00:00
parent 03a39741e4
commit 5b58df4f5b
2 changed files with 26 additions and 17 deletions

View file

@ -127,6 +127,10 @@ namespace BSB.bottypes
} }
} }
} }
lock (AvatarName2Key)
{
lock (AvatarStorageLastUsed)
{
foreach (string purge in PurgeAvatars) foreach (string purge in PurgeAvatars)
{ {
if (purge != myconfig.Security_MasterUsername) if (purge != myconfig.Security_MasterUsername)
@ -144,6 +148,8 @@ namespace BSB.bottypes
} }
} }
} }
}
}
protected override void AfterBotLoginHandler() protected override void AfterBotLoginHandler()
{ {

View file

@ -19,6 +19,8 @@ namespace BSB.bottypes
} }
public override void ResetAnimations() public override void ResetAnimations()
{
lock (active_animations)
{ {
foreach (UUID ani in active_animations) foreach (UUID ani in active_animations)
{ {
@ -26,6 +28,7 @@ namespace BSB.bottypes
} }
active_animations.Clear(); active_animations.Clear();
} }
}
protected override void AvatarAnimationHandler(object sender, AvatarAnimationEventArgs e) protected override void AvatarAnimationHandler(object sender, AvatarAnimationEventArgs e)
{ {