dtr: null-check storage when removing

This commit is contained in:
goat 2024-07-18 00:34:57 +02:00
parent 30581d534a
commit 4df124440e

View file

@ -146,9 +146,13 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
internal void RemoveEntry(DtrBarEntry toRemove) internal void RemoveEntry(DtrBarEntry toRemove)
{ {
this.RemoveNode(toRemove.TextNode); this.RemoveNode(toRemove.TextNode);
if (toRemove.Storage != null)
{
toRemove.Storage->Dtor(true); toRemove.Storage->Dtor(true);
toRemove.Storage = null; toRemove.Storage = null;
} }
}
/// <summary> /// <summary>
/// Check whether an entry with the specified title exists. /// Check whether an entry with the specified title exists.