Fixes server shutdown crash & client error log spam. (#67)

This commit is contained in:
Pieter-Jan Briers
2018-05-10 18:52:44 +02:00
committed by GitHub
parent 2d9285f790
commit 205a4fc530
2 changed files with 15 additions and 6 deletions

View File

@@ -27,6 +27,13 @@ namespace Content.Client.GameObjects
private string TemplateName = "HumanInventory"; //stored for serialization purposes private string TemplateName = "HumanInventory"; //stored for serialization purposes
public event EventHandler<BoundKeyChangedMessage> OnCharacterMenuKey; public event EventHandler<BoundKeyChangedMessage> OnCharacterMenuKey;
public override void OnRemove()
{
base.OnRemove();
Window.Dispose();
}
public override void ExposeData(EntitySerializer serializer) public override void ExposeData(EntitySerializer serializer)
{ {
base.ExposeData(serializer); base.ExposeData(serializer);

View File

@@ -13,6 +13,7 @@ using SS14.Shared.IoC;
using SS14.Server.Interfaces.Player; using SS14.Server.Interfaces.Player;
using SS14.Shared.GameObjects.Serialization; using SS14.Shared.GameObjects.Serialization;
using SS14.Shared.ContentPack; using SS14.Shared.ContentPack;
using System.Linq;
namespace Content.Server.GameObjects namespace Content.Server.GameObjects
{ {
@@ -44,7 +45,8 @@ namespace Content.Server.GameObjects
public override void OnRemove() public override void OnRemove()
{ {
foreach (var slot in SlotContainers.Keys) var slots = SlotContainers.Keys.ToList();
foreach (var slot in slots)
{ {
RemoveSlot(slot); RemoveSlot(slot);
} }