From 261f5d8e3fd4fa2f65c62ad8c21666edea45fd65 Mon Sep 17 00:00:00 2001 From: Ertanic Date: Fri, 27 Sep 2024 09:53:17 +0300 Subject: [PATCH] EntityPrototypeView has become disposable --- .../UserInterface/Controls/EntityPrototypeView.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Robust.Client/UserInterface/Controls/EntityPrototypeView.cs b/Robust.Client/UserInterface/Controls/EntityPrototypeView.cs index 5aa23f3dc33..cab5e62706d 100644 --- a/Robust.Client/UserInterface/Controls/EntityPrototypeView.cs +++ b/Robust.Client/UserInterface/Controls/EntityPrototypeView.cs @@ -56,4 +56,15 @@ protected override void ExitedTree() base.ExitedTree(); EntMan.TryQueueDeleteEntity(_ourEntity); } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (!disposing) + return; + + if (_ourEntity is not null) + EntMan.DeleteEntity(_ourEntity); + } }