Skip to content

Commit

Permalink
Add obsoletion warning on control dispose
Browse files Browse the repository at this point in the history
this shouldn't be used anymore
  • Loading branch information
PJB3005 committed Jul 20, 2024
1 parent 2e4275a commit 16a93e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ END TEMPLATE-->

### Other

*None yet*
* Added obsoletion warning for `Control.Dispose()`. New code should not rely on it.

### Internal

Expand Down
2 changes: 2 additions & 0 deletions Robust.Client/UserInterface/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ protected internal virtual void ModalRemoved()
/// Dispose this control, its own scene control, and all its children.
/// Basically the big delete button.
/// </summary>
[Obsolete("Controls should only be removed from UI tree instead of being disposed")]
public void Dispose()
{
if (Disposed)
Expand All @@ -613,6 +614,7 @@ public void Dispose()
Disposed = true;
}

[Obsolete("Controls should only be removed from UI tree instead of being disposed")]
protected virtual void Dispose(bool disposing)
{
if (!disposing)
Expand Down

0 comments on commit 16a93e8

Please sign in to comment.