Skip to content

Commit

Permalink
- Added disposal check to IService interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
TBN-MapleWheels committed Dec 5, 2024
1 parent 7b5c7a8 commit 7d050a1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ public interface IReusableService : IService
/// </summary>
public interface IService : IDisposable
{

bool IsDisposed { get; }
virtual void CheckDisposed()
{
if (IsDisposed)
throw new ObjectDisposedException($"Tried to call method on disposed object '{this.GetType().Name}'!");
}
}

0 comments on commit 7d050a1

Please sign in to comment.